[PROPOSED] Pacify clang -Wunterminated-string-initialization
March 1, 2026
12:20 a.m.
* private.h (ATTRIBUTE_NONSTRING): Also define for Clang 21+. --- private.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/private.h b/private.h index 6a58b073..ee191b4e 100644 --- a/private.h +++ b/private.h @@ -539,9 +539,12 @@ typedef unsigned long uintmax_t; # define HAVE___HAS_C_ATTRIBUTE false #endif -#if 8 <= __GNUC__ -# define ATTRIBUTE_NONSTRING __attribute__((__nonstring__)) -#else +#ifdef __has_attribute +# if __has_attribute (nonstring) +# define ATTRIBUTE_NONSTRING __attribute__((__nonstring__)) +# endif +#endif +#ifndef ATTRIBUTE_NONSTRING # define ATTRIBUTE_NONSTRING #endif -- 2.53.0
43
Age (days ago)
43
Last active (days ago)
0 comments
1 participants
participants (1)
-
Paul Eggert