]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use -Wold-style-definition.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 21 Oct 2015 15:14:13 +0000 (15:14 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 21 Oct 2015 15:14:13 +0000 (15:14 +0000)
This patch makes glibc build with -Wold-style-definition to avoid
old-style function definitions creeping back in by accident.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).  Also tested build for arm,
mips64 and powerpc32.  Hopefully there aren't any remaining
system-specific files with old-style definitions whose formatting
evaded my searches, but if there are, they will be easy to fix.

* Makeconfig (+gccwarn-c): Add -Wold-style-definition.
* Makefile ($(objpfx)c++-types-check.out): Filter out
$(+gccwarn-c) instead of -Wstrict-prototypes.

ChangeLog
Makeconfig
Makefile

index d08674e478f4a8bd80c932a41cb7156fafe1a5d0..b05d6d0e9f1256b2fc5a33df6cf93795055dfbad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-10-21  Joseph Myers  <joseph@codesourcery.com>
 
+       * Makeconfig (+gccwarn-c): Add -Wold-style-definition.
+       * Makefile ($(objpfx)c++-types-check.out): Filter out
+       $(+gccwarn-c) instead of -Wstrict-prototypes.
+
        * io/fts.c (fts_open): Convert to prototype-style function
        definition.
        * malloc/mcheck.c (mcheck): Likewise.
index 1dc522c7edcd0d1002f04c8d3bbba6ba07cd010f..f3668c616a9da851a95fb9969acd0782758ea587 100644 (file)
@@ -752,7 +752,7 @@ endif
 ifeq ($(enable-werror),yes)
 +gccwarn += -Werror
 endif
-+gccwarn-c = -Wstrict-prototypes
++gccwarn-c = -Wstrict-prototypes -Wold-style-definition
 
 # We do not depend on the address of constants in different files to be
 # actually different, so allow the compiler to merge them all.
index a2abfb927335ccd480b2c993967aa752c0453c44..b2dd771a19774b2d22c41819771fb79508f886fd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -256,7 +256,7 @@ ifneq ($(CXX),no)
 vpath c++-types.data $(+sysdep_dirs)
 
 $(objpfx)c++-types-check.out: c++-types.data scripts/check-c++-types.sh
-       scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu99 -Wstrict-prototypes,$(CFLAGS)) $(CPPFLAGS) > $@; \
+       scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu99 $(+gccwarn-c),$(CFLAGS)) $(CPPFLAGS) > $@; \
        $(evaluate-test)
 endif