From 337e3ad58a7b6be7f146b2c14065b5188e329943 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 29 Nov 2011 18:33:31 +0100 Subject: [PATCH] build: accommodate gnulib's new warnings with --enable-gcc-warnings * configure.ac (WERROR_CFLAGS): Disable two new warnings: -Wno-format-nonliteral, -Wno-unsuffixed-float-constants. * gzip.h (bi_reverse): Declare with _GL_ATTRIBUTE_CONST. (gzip_base_name): Declare with _GL_ATTRIBUTE_PURE. --- configure.ac | 2 ++ gzip.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4013dfc..6e3e19b 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,8 @@ if test "$gl_gcc_warnings" = yes; then gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now gl_WARN_ADD([-Wno-overflow]) # util.c gl_WARN_ADD([-Wno-type-limits]) # util.c + gl_WARN_ADD([-Wno-format-nonliteral]) + gl_WARN_ADD([-Wno-unsuffixed-float-constants]) # In spite of excluding -Wlogical-op above, it is enabled, as of # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c diff --git a/gzip.h b/gzip.h index 568ffb0..49a9dbd 100644 --- a/gzip.h +++ b/gzip.h @@ -292,7 +292,7 @@ extern off_t flush_block (char *buf, ulg stored_len, int eof); /* in bits.c */ extern void bi_init (file_t zipfile); extern void send_bits (int value, int length); -extern unsigned bi_reverse (unsigned value, int length); +extern unsigned bi_reverse (unsigned value, int length) _GL_ATTRIBUTE_CONST; extern void bi_windup (void); extern void copy_block (char *buf, unsigned len, int header); extern int (*read_buf) (char *buf, unsigned size); @@ -307,7 +307,7 @@ extern void flush_window (void); extern void write_buf (int fd, voidp buf, unsigned cnt); extern int read_buffer (int fd, voidp buf, unsigned int cnt); extern char *strlwr (char *s); -extern char *gzip_base_name (char *fname); +extern char *gzip_base_name (char *fname) _GL_ATTRIBUTE_PURE; extern int xunlink (char *fname); extern void make_simple_name (char *name); extern char *add_envopt (int *argcp, char ***argvp, char const *env); -- 2.47.2