diff options
| -rw-r--r-- | auto/clang | 14 | ||||
| -rw-r--r-- | src/nxt_clang.h | 11 |
2 files changed, 25 insertions, 0 deletions
@@ -194,3 +194,17 @@ nxt_feature_test="static void f(void) __attribute__ ((__unused__)); return 0; }" . auto/feature + + +nxt_feature="GCC __attribute__ nonstring" +nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_NONSTRING +nxt_feature_run= +nxt_feature_incs= +nxt_feature_libs= +nxt_feature_test="int main(void) { + static const char str[3] __attribute__ ((__nonstring__)) = + \"ABC\"; + + return !!str[0]; + }" +. auto/feature diff --git a/src/nxt_clang.h b/src/nxt_clang.h index 6803ffc8..872f1527 100644 --- a/src/nxt_clang.h +++ b/src/nxt_clang.h @@ -131,6 +131,17 @@ #endif +#if (NXT_HAVE_GCC_ATTRIBUTE_NONSTRING) + +#define NXT_NONSTRING __attribute__((__nonstring__)) + +#else + +#define NXT_NONSTRING + +#endif + + #if (NXT_HAVE_BUILTIN_POPCOUNT) #define nxt_popcount __builtin_popcount |
