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