From: Theodore Ts'o Date: Sun, 29 May 2016 21:07:17 +0000 (-0400) Subject: Fix "make gcc-wall" for library code X-Git-Tag: v1.43.1~31 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c2ff6bac501ce53580fb6d7970606b01f9ed3644;p=tools%2Fe2fsprogs.git Fix "make gcc-wall" for library code 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 --- diff --git a/MCONFIG.in b/MCONFIG.in index db4b4de..9fa9f88 100644 --- a/MCONFIG.in +++ b/MCONFIG.in @@ -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 diff --git a/util/gcc-wall-cleanup b/util/gcc-wall-cleanup index c619526..52a80d5 100644 --- a/util/gcc-wall-cleanup +++ b/util/gcc-wall-cleanup @@ -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