1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

add -Wno-unterminated-string-initialization

Without this on some new compilers this raises a warning (or error with -Werror):
const char hexchars[16] = "0123456789abcdef";

The alternative is to add __attribute__((nonstring)) at the various places
that need it. But 1) that requires various ifdefs to support old compilers, and
2) This doesn't catch anything meaningful in our code anyway and the odds of
it doing so seem slim.
This commit is contained in:
Bram Matthys
2025-09-15 07:44:54 +02:00
parent 0b147e8044
commit 2798276316
2 changed files with 54 additions and 0 deletions
+3
View File
@@ -260,6 +260,9 @@ check_cc_flag([-Wempty-body], [CFLAGS="$CFLAGS -Wno-empty-body"])
dnl This warns about all our hook calls - RunHook() and others
check_cc_flag([-Wdeprecated-non-prototype], [CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"])
dnl This warns about const char hexchars[16] = "0123456789abcdef";
check_cc_flag([-Wunterminated-string-initialization], [CFLAGS="$CFLAGS -Wno-unterminated-string-initialization"])
dnl Yeah this old clang version is a bit problematic
dnl (ships in Ubuntu 16.04 for example)
dnl -Wtautological-compare has false positives