Now that gnulib's lib/ (at least the part coreutils uses) is ready for -Wsuggest-attribute=pure|const, I've changed coreutils to enable those options for lib/ -- but still not for gnulib-tests/:
>From 1e676ec8443f096f7e46aeef781301e38ef30f1d Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Mon, 28 Nov 2011 09:28:33 +0100 Subject: [PATCH 1/2] build: update gnulib for const+pure attributes --- gnulib | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gnulib b/gnulib index 811f969..69f517e 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 811f969f5fc9a0a079f15213a99347156a54ff47 +Subproject commit 69f517e5975418e7b2c5033f8f60191919f44b9d -- 1.7.8.rc3.31.g017d1 >From 73a9acd6e885ae1e1e0dd2e5038df687f9b83c19 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Sun, 27 Nov 2011 16:13:26 +0100 Subject: [PATCH 2/2] build: enable -Wsuggest-attribute=pure|const in lib/,... but not in gnulib-tests/. * configure.ac (GNULIB_WARN_CFLAGS): Do not exclude -Wsuggest-attribute=pure|const, thus enabling these two warning options in lib/, since gnulib now toes the line. Continue to disable them in gnulib-tests/, since some programs there trigger these suggestions and are not worth fixing. --- configure.ac | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index a174178..8c4fff4 100644 --- a/configure.ac +++ b/configure.ac @@ -156,15 +156,15 @@ if test "$gl_gcc_warnings" = yes; then # FIXME: it may be easy to remove this, since it affects only one file: # the snprintf call at ftoastr.c:132. nw="$nw -Wdouble-promotion" - # FIXME: remove/reenable the following two, once gnulib is adjusted. - nw="$nw -Wsuggest-attribute=const" - nw="$nw -Wsuggest-attribute=pure" gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) AC_SUBST([GNULIB_WARN_CFLAGS]) # For gnulib-tests, the set is slightly smaller still. nw= nw="$nw -Wstrict-prototypes" + # It's not worth being this picky about test programs. + nw="$nw -Wsuggest-attribute=const" + nw="$nw -Wsuggest-attribute=pure" gl_MANYWARN_COMPLEMENT([GNULIB_TEST_WARN_CFLAGS], [$GNULIB_WARN_CFLAGS], [$nw]) AC_SUBST([GNULIB_TEST_WARN_CFLAGS]) -- 1.7.8.rc3.31.g017d1
