build: accommodate gnulib's new warnings with --enable-gcc-warnings
authorJim Meyering <meyering@redhat.com>
Tue, 29 Nov 2011 17:33:31 +0000 (18:33 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 29 Nov 2011 17:33:36 +0000 (18:33 +0100)
* 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
gzip.h

index 4013dfc5592783e210db37de411f8a3f4c4d57a6..6e3e19b9c47342084a69e7cae99908aedcf13fe0 100644 (file)
@@ -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 568ffb0cf0680969e2be70fd3f4bb1a0d477c488..49a9dbdc9563b6368c3831d30977953356d4f3e1 100644 (file)
--- 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);