From ca8375f0e9d1715e38c14c918c675d6774f1eabc Mon Sep 17 00:00:00 2001 From: psykose Date: Sun, 22 Jan 2023 07:55:14 +0000 Subject: [PATCH] abuild.conf: define format-security and int-conversion errors format-security warns of usage such as `printf(x)`, which is usually a security hole. int-conversion is very useful to find cases such as ``` error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion] msg = strerror_r(errnum, buf, buflen); ``` where the usage of things like the wrong strerror_r are legitimate errors in the application that cause it to crash. it makes more sense for the compiler to reject it instead, and this does that. --- abuild.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abuild.conf b/abuild.conf index b921bf1..571f1af 100644 --- a/abuild.conf +++ b/abuild.conf @@ -1,4 +1,4 @@ -export CFLAGS="-Os -fomit-frame-pointer" +export CFLAGS="-Os -fomit-frame-pointer -Werror=format-security -Werror=int-conversion" export CXXFLAGS="$CFLAGS" export CPPFLAGS="$CFLAGS" export LDFLAGS="-Wl,--as-needed,-O1,--sort-common"