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.
This commit is contained in:
psykose 2023-01-22 07:55:14 +00:00 committed by alice
parent 4258b204fe
commit ca8375f0e9
1 changed files with 1 additions and 1 deletions

View File

@ -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"