Whamcloud - gitweb
Fix "make gcc-wall" for library code
authorTheodore Ts'o <tytso@mit.edu>
Sun, 29 May 2016 21:07:17 +0000 (17:07 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 29 May 2016 21:07:17 +0000 (17:07 -0400)
Commit fd1677e80: "Add --enable-hardening which builds e2fsprogs with
security hardening" broken the gcc warnings mode by changing how
CFLAGS were used to build static and shared library objects.

Also shut up GCC's whining about casting the return value from
dlsym(2) to function pointers --- since due to conflicing standards,
there is no way to use dlsym() without causing gcc to whine one way or
another.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
MCONFIG.in
util/gcc-wall-cleanup

index db4b4de..9fa9f88 100644 (file)
@@ -77,9 +77,9 @@ CFLAGS = @CFLAGS@
 CFLAGS_SHLIB = @CFLAGS_SHLIB@
 CFLAGS_STLIB = @CFLAGS_STLIB@
 CPPFLAGS = @INCLUDES@
-ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) @DEFS@ $(LOCAL_CFLAGS)
-ALL_CFLAGS_SHLIB = $(CPPFLAGS) $(CFLAGS_SHLIB) @DEFS@ $(LOCAL_CFLAGS)
-ALL_CFLAGS_STLIB = $(CPPFLAGS) $(CFLAGS_STLIB) @DEFS@ $(LOCAL_CFLAGS)
+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS)
+ALL_CFLAGS_SHLIB = $(CPPFLAGS) $(CFLAGS_SHLIB) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS)
+ALL_CFLAGS_STLIB = $(CPPFLAGS) $(CFLAGS_STLIB) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS)
 LDFLAGS = @LDFLAGS@
 LDFLAGS_SHLIB = @LDFLAGS_SHLIB@
 ALL_LDFLAGS = $(LDFLAGS) @LDFLAG_DYNAMIC@
@@ -203,7 +203,7 @@ WFLAGS=             -std=gnu99 -D_XOPEN_SOURCE=600 -D_GNU_SOURCE \
                        -UENABLE_NLS
 
 gcc-wall-new:
-       ($(MAKE) CFLAGS="$(ALL_CFLAGS) $(WFLAGS)" > /dev/null) 2>&1 | sed -f $(top_srcdir)/util/gcc-wall-cleanup
+       ($(MAKE) CFLAGS_WARN="$(WFLAGS)" > /dev/null) 2>&1 | sed -f $(top_srcdir)/util/gcc-wall-cleanup
 
 gcc-wall:
        $(MAKE) clean > /dev/null
index c619526..52a80d5 100644 (file)
@@ -12,6 +12,7 @@
 /ANSI C forbids long long integer constants/d
 /traditional C rejects string concatenation/d
 /integer constant is unsigned in ANSI C, signed with -traditional/d
+/ISO C forbids conversion of object pointer to function pointer type/,+2d
 /At top level:/d
 /In file included from/d
 /In function `.*':/d