]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: avoid "attribute-const"-suggesting warning from gcc
authorJim Meyering <meyering@fb.com>
Mon, 18 Nov 2013 18:13:06 +0000 (10:13 -0800)
committerJim Meyering <meyering@fb.com>
Thu, 13 Mar 2014 17:15:28 +0000 (10:15 -0700)
* gl/lib/fadvise.c: Use a pragma to turn off this warning option:
-Wsuggest-attribute=const.  Without this change, building with
--enable-gcc-warnings would evoke this error:

    lib/fadvise.c:25:1: error: function might be candidate for\
    attribute 'const' [-Werror=suggest-attribute=const]

gl/lib/fadvise.c

index 3456ce1872e70145017e124b33b660ea3fae93a1..562f1eb6ac6e5bc01dd7996e790a0119e3ced1d7 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+/* Without this pragma, gcc suggests that (given !HAVE_POSIX_FADVISE)
+   the the fdadvise 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 "fadvise.h"