This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch roland/Wundef created. glibc-2.20-576-g4e1d2d3


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, roland/Wundef has been created
        at  4e1d2d363b8bb2bcaf3e297427456356dca4ca8e (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4e1d2d363b8bb2bcaf3e297427456356dca4ca8e

commit 4e1d2d363b8bb2bcaf3e297427456356dca4ca8e
Author: Roland McGrath <roland@hack.frob.com>
Date:   Fri Jan 30 15:26:34 2015 -0800

    Put -Wundef and -Werror in CPPFLAGS, not just CFLAGS.

diff --git a/ChangeLog b/ChangeLog
index 26f7f3f..e23f710 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-01-30  Roland McGrath  <roland@hack.frob.com>
+
+	* Makeconfig (+gccwarn): Don't add -Wundef here.
+	(CPPFLAGS): Instead put it first thing here.
+	Also add -Werror if $(enable-werror) is yes.
+	* include/libc-symbols.h (IN_MODULE, IS_IN, IS_IN_LIB): Move these
+	macros under [MODULE_NAME].
+	[!MODULE_NAME] (IS_IN): New macro, always yields 0.
+	* sysdeps/unix/make-syscalls.sh: Always emit #define's for
+	SYSCALL_CANCELLABLE, SYSCALL_NOERRNO, SYSCALL_ERRVAL, to 1 or 0.
+
 2015-01-29  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/nptl/allocrtsig.c: Include <signal.h>.
diff --git a/Makeconfig b/Makeconfig
index 751e9ff..f878046 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -716,9 +716,10 @@ ifeq ($(all-warnings),yes)
 else
 +gccwarn := -Wall -Wwrite-strings -Winline
 endif
-+gccwarn += -Wundef
 ifeq ($(enable-werror),yes)
-+gccwarn += -Werror -Wno-error=undef
+# -Werror is in CPPFLAGS (below).  XXX Disable it for -Wundef in C/C++
+# code, for now, because some test sources still need to be fixed up.
++gccwarn += -Wno-error=undef
 endif
 +gccwarn-c = -Wstrict-prototypes
 
@@ -844,7 +845,8 @@ module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
 # it causes cpp to stop predefining __ASSEMBLER__.
-CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
+CPPFLAGS = -Wundef $(if $(filter yes,$(enable-werror)),-Werror) \
+	   $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
 	   $(+includes) $(defines) $(module-cppflags) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 2da0ab4..12ea810 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,16 +20,30 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
-#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
-#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+#ifdef MODULE_NAME
+
+# define IN_MODULE		PASTE_NAME (MODULE_, MODULE_NAME)
+# define IS_IN(lib)		(IN_MODULE == MODULE_##lib)
 
 /* Returns true if the current module is a versioned library.  Versioned
    library names culled from shlib-versions files are assigned a MODULE_*
    value lower than MODULE_LIBS_BEGIN.  */
-#define IS_IN_LIB (IN_MODULE > MODULE_LIBS_BEGIN)
+# define IS_IN_LIB		(IN_MODULE > MODULE_LIBS_BEGIN)
+
+# define PASTE_NAME(a,b)	PASTE_NAME1 (a,b)
+# define PASTE_NAME1(a,b)	a##b
+
+#else
 
-#define PASTE_NAME(a,b)      PASTE_NAME1 (a,b)
-#define PASTE_NAME1(a,b)     a##b
+/* In actual compilation, MODULE_NAME is defined on the command line
+   (see Makeconfig).  The only time it should be undefined is for some
+   preprocessing-only runs used for files that are neither C nor
+   assembly.  In those cases, the IN_LIB result doesn't matter to
+   anything, but we must avoid -Wundef errors.  */
+
+# define IS_IN(lib)		0
+
+#endif
 
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index 567081a..e3596b6 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -250,14 +250,10 @@ while read file srcfile caller syscall args strong weak; do
 	\$(make-target-directory)
 	(echo '#define SYSCALL_NAME $syscall'; \\
 	 echo '#define SYSCALL_NARGS $nargs'; \\
-	 echo '#define SYSCALL_SYMBOL $strong'; \\"
-  [ $cancellable = 0 ] || echo "\
-	 echo '#define SYSCALL_CANCELLABLE 1'; \\"
-  [ $noerrno = 0 ] || echo "\
-	 echo '#define SYSCALL_NOERRNO 1'; \\"
-  [ $errval = 0 ] || echo "\
-	 echo '#define SYSCALL_ERRVAL 1'; \\"
-  echo "\
+	 echo '#define SYSCALL_SYMBOL $strong'; \\
+	 echo '#define SYSCALL_CANCELLABLE $cancellable'; \\
+	 echo '#define SYSCALL_NOERRNO $noerrno'; \\
+	 echo '#define SYSCALL_ERRVAL $errval'; \\
 	 echo '#include <syscall-template.S>'; \\"
   ;;
   esac

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]