From: Greg Hudson Date: Wed, 9 Dec 2015 19:56:34 +0000 (-0500) Subject: Error on incompatible argument types if possible X-Git-Tag: krb5-1.15-beta1~320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d69a3bd4c1d0c39a1f527c97f12bc53ea0cc1b8b;p=thirdparty%2Fkrb5.git 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. --- 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