From d69a3bd4c1d0c39a1f527c97f12bc53ea0cc1b8b Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Wed, 9 Dec 2015 14:56:34 -0500 Subject: [PATCH] Error on incompatible argument types if possible gcc 4.x has no option short of -Werror to error on "makes pointer from integer without a cast" or "incompatible pointer type" warnings, but clang and (I think) gcc 5.x do. Use -Werror=int-conversion and -Werror=incompatible-pointer-types when the compiler supports them. At least in clang, -Werror=incompatible-pointer-types also throws an error when passing an argument discards a const qualifier, which is a less serious type violation. But cleaning those up is relatively easy. --- src/aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index dbb7db2eb2..e2d5434eed 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -526,7 +526,7 @@ if test "$GCC" = yes ; then TRY_WARN_CC_FLAG(-Wno-format-zero-length) # Other flags here may not be supported on some versions of # gcc that people want to use. - for flag in overflow strict-overflow missing-format-attribute missing-prototypes return-type missing-braces parentheses switch unused-function unused-label unused-variable unused-value unknown-pragmas sign-compare newline-eof error=uninitialized error=pointer-arith ; do + for flag in overflow strict-overflow missing-format-attribute missing-prototypes return-type missing-braces parentheses switch unused-function unused-label unused-variable unused-value unknown-pragmas sign-compare newline-eof error=uninitialized error=pointer-arith error=int-conversion error=incompatible-pointer-types ; do TRY_WARN_CC_FLAG(-W$flag) done # old-style-definition? generates many, many warnings -- 2.47.2