Skip to content

Commit

Permalink
Restore (some) compiler sanity
Browse files Browse the repository at this point in the history
-fno-strict-overflow tells gcc and clang to handle signed integer and
(at least on gcc) pointer arithmetic wraparound using twos-complement
representation like deity intended.

-fno-delete-null-pointer-checks tells gcc not to "optimize" away
programmer added safeguards. Really.

Suggested by Demi Marie Obenour.
  • Loading branch information
pmatilai committed Mar 19, 2021
1 parent b121907 commit 5ee567e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -37,7 +37,7 @@ fi
AS=${AS-as}
AC_SUBST(AS)
if test "$GCC" = yes; then
cflags_to_try="-fno-strict-aliasing -Wempty-body"
cflags_to_try="-fno-strict-aliasing -fno-strict-overflow -fno-delete-null-pointer-checks -Wempty-body"
AC_MSG_CHECKING([supported compiler flags])
old_cflags=$CFLAGS
echo
Expand Down

0 comments on commit 5ee567e

Please sign in to comment.