]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Error on discarded qualifiers in gcc 549/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 4 Oct 2016 16:36:30 +0000 (12:36 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 6 Oct 2016 15:05:08 +0000 (11:05 -0400)
If a function call passes a const pointer to a function accepting the
same pointer type without the const qualifier, that should be treated
as an erorr if possible.  In sufficiently recent gcc, pass
-Werror=discarded-qualifiers.  (In clang, this is already covered by
-Werror=incompatible-pointer-types which we recently added.)

src/aclocal.m4

index b9f9d2af1b83382b9d2195c64efb8211ce670451..bd2eb48d96d978c797ce14eb942c6b4a4df2da96 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 error=int-conversion error=incompatible-pointer-types ; 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 error=discarded-qualifiers ; do
       TRY_WARN_CC_FLAG(-W$flag)
     done
     #  old-style-definition? generates many, many warnings