krb5 commit: Error on incompatible argument types if possible

Greg Hudson ghudson at mit.edu
Thu Dec 10 16:32:09 EST 2015


https://github.com/krb5/krb5/commit/d69a3bd4c1d0c39a1f527c97f12bc53ea0cc1b8b
commit d69a3bd4c1d0c39a1f527c97f12bc53ea0cc1b8b
Author: Greg Hudson <ghudson at mit.edu>
Date:   Wed Dec 9 14:56:34 2015 -0500

    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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/aclocal.m4 b/src/aclocal.m4
index dbb7db2..e2d5434 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


More information about the cvs-krb5 mailing list