summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2013-11-18 10:13:06 -0800
committerJim Meyering <meyering@fb.com>2014-03-13 10:15:28 -0700
commit4f211822dddd1777dc915f2df4e2ed3b65c68301 (patch)
tree20f3720f58f76a988cb2980f10c14116c9bdb03b /gl
parent42d2377b813507d50f5a67076bb20134ceb2fc10 (diff)
downloadcoreutils-4f211822dddd1777dc915f2df4e2ed3b65c68301.tar.xz
maint: avoid "attribute-const"-suggesting warning from gcc
* 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]
Diffstat (limited to 'gl')
-rw-r--r--gl/lib/fadvise.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gl/lib/fadvise.c b/gl/lib/fadvise.c
index 3456ce187..562f1eb6a 100644
--- a/gl/lib/fadvise.c
+++ b/gl/lib/fadvise.c
@@ -14,6 +14,12 @@
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"