]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Error on incompatible argument types if possible 364/head
authorGreg Hudson <ghudson@mit.edu>
Wed, 9 Dec 2015 19:56:34 +0000 (14:56 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 10 Dec 2015 21:16:23 +0000 (16:16 -0500)
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

index dbb7db2eb29ac4f5a70cb2c9ec0b26d0b83024e2..e2d5434eed3a32180a17b56af7bc70ecae82a5ea 100644 (file)
@@ -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