Add __attribute__((__format__)) to snprintf

This attribute will check format string bugs and is required for clean compile if -Wformat-nonliteral is enabled.
This commit is contained in:
Ed Catmur authored and GitHub committed 2021-10-29 11:59:03 +01:00
1 parent bfebaf53d7
commit 9b0d735040
1 file changed
+3
+3
View File
@@ -49,6 +49,9 @@ inline void snprintf( char * buffer, std::size_t len, char const * format, ... )
#else
#if __GNUC__ >= 3
__attribute__((__format__ (__printf__, 3, 4)))
#endif
inline void snprintf( char * buffer, std::size_t len, char const * format, ... )
{
va_list args;