Compare commits

..

2 commits

Author SHA1 Message Date
cgzones
09972b08d2
Merge 5f62334695 into 4fe9018b6f 2025-03-26 09:22:01 +00:00
Christian Göttsche
5f62334695 support GCC15
GCC 15 starts warning about non NUL-terminated string literals:

    chacha.c:44:31: error: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 available) [-Werror=unterminated-string-initialization]
       44 | static const char sigma[16] = "expand 32-byte k";
          |                               ^~~~~~~~~~~~~~~~~~
2025-03-26 10:21:16 +01:00

6
util.h
View file

@ -33,8 +33,12 @@
#define ALIAS(f) __attribute__((alias(STRINGIFY(f)))) #define ALIAS(f) __attribute__((alias(STRINGIFY(f))))
// supported since GCC 15 // supported since GCC 15
#if __has_attribute (nonstring) #if defined __has_attribute
# if __has_attribute (nonstring)
# define NONSTRING __attribute__ ((nonstring)) # define NONSTRING __attribute__ ((nonstring))
# else
# define NONSTRING
# endif
#else #else
# define NONSTRING # define NONSTRING
#endif #endif