]> Savannah Git Hosting - gnulib.git/commitdiff
file-has-acl: suppress a warning from gcc -Wsuggest-attribute=const
authorJim Meyering <meyering@redhat.com>
Thu, 2 Feb 2012 08:12:13 +0000 (09:12 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 2 Feb 2012 08:12:13 +0000 (09:12 +0100)
* lib/file-has-acl.c (file_has_acl): This function (for some #ifdefs)
would evoke a new gcc warning.  Given all of the #ifdefs, it is better
not even to try to add the attribute.  Instead, add a pragma to suppress
the suggestion/warning.

ChangeLog
lib/file-has-acl.c

index f80c7dda9243de744562764686e1f34813bdeb55..9c5a3cdc5cc9ef43d1b3a736396778e8829b9f19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-02-02  Jim Meyering  <meyering@redhat.com>
+
+       file-has-acl: suppress a warning from gcc -Wsuggest-attribute=const
+       * lib/file-has-acl.c (file_has_acl): This function (for some #ifdefs)
+       would evoke a new gcc warning.  Given all of the #ifdefs, it is better
+       not even to try to add the attribute.  Instead, add a pragma to suppress
+       the suggestion/warning.
+
 2012-01-31  Karl Berry  <karl@gnu.org>
 
        setstate doc: typo.
index b7c14845150118968c0b04051c1ee202b8037bbe..89a63a658c6d3b0108e0638fedb775817b443a8a 100644 (file)
 
    Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible.  */
 
+/* Without this pragma, gcc 4.7.0 20120126 may suggest that the
+   file_has_acl function might be candidate for attribute 'const'  */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
+#endif
+
 #include <config.h>
 
 #include "acl.h"