c6d234
commit 8e2f7c68111ba8fae795ee08b6822e21ab8cfa38
c6d234
Author: Joseph Myers <joseph@codesourcery.com>
c6d234
Date:   Wed Oct 21 15:14:13 2015 +0000
c6d234
c6d234
    Use -Wold-style-definition.
c6d234
    
c6d234
    This patch makes glibc build with -Wold-style-definition to avoid
c6d234
    old-style function definitions creeping back in by accident.
c6d234
    
c6d234
    Tested for x86_64 and x86 (testsuite, and that installed shared
c6d234
    libraries are unchanged by the patch).  Also tested build for arm,
c6d234
    mips64 and powerpc32.  Hopefully there aren't any remaining
c6d234
    system-specific files with old-style definitions whose formatting
c6d234
    evaded my searches, but if there are, they will be easy to fix.
c6d234
    
c6d234
            * Makeconfig (+gccwarn-c): Add -Wold-style-definition.
c6d234
            * Makefile ($(objpfx)c++-types-check.out): Filter out
c6d234
            $(+gccwarn-c) instead of -Wstrict-prototypes.
c6d234
c6d234
Conflicts:
c6d234
	Makefile
c6d234
c6d234
Resolved conflict due to missing $(evaluate-test) in the tree (commit
c6d234
f0881698bf244bcb16c394d2d6258d975a11baef, Generate .test-result files
c6d234
for tests with special rules.).
c6d234
c6d234
diff --git a/Makeconfig b/Makeconfig
c6d234
index 3c0d4abc5f5f30df..f8313c9774d47522 100644
c6d234
--- a/Makeconfig
c6d234
+++ b/Makeconfig
c6d234
@@ -647,7 +647,7 @@ endif
c6d234
 ifeq ($(enable-werror),yes)
c6d234
 +gccwarn += -Werror
c6d234
 endif
c6d234
-+gccwarn-c = -Wstrict-prototypes
c6d234
++gccwarn-c = -Wstrict-prototypes -Wold-style-definition
c6d234
 
c6d234
 # We do not depend on the address of constants in different files to be
c6d234
 # actually different, so allow the compiler to merge them all.
c6d234
diff --git a/Makefile b/Makefile
c6d234
index bebb0a865a150a3a..f4128c2627dd0bb9 100644
c6d234
--- a/Makefile
c6d234
+++ b/Makefile
c6d234
@@ -279,7 +279,7 @@ ifneq ($(CXX),no)
c6d234
 vpath c++-types.data $(+sysdep_dirs)
c6d234
 
c6d234
 $(objpfx)c++-types-check.out: c++-types.data scripts/check-c++-types.sh
c6d234
-	scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu99 -Wstrict-prototypes,$(CFLAGS)) $(CPPFLAGS) > $@
c6d234
+	scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu99 $(+gccwarn-c),$(CFLAGS)) $(CPPFLAGS) > $@
c6d234
 endif
c6d234
 
c6d234
 $(objpfx)check-local-headers.out: scripts/check-local-headers.sh