# HG changeset patch # User Jim Meyering # Date 1328170333 -3600 # Node ID 3bec4206b1cc81e9d84b15565a5d93a2ba7f0956 # Parent 90c6dac9de6a2c10d6d1c3bab581904a3d81e023 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. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-02-02 Jim Meyering + + 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 setstate doc: typo. diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -17,6 +17,12 @@ 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 #include "acl.h"