From 3ccfe7cb7be80cc6fa5b8fc437af72168515b892 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 10 May 2011 11:37:30 +0930 Subject: [PATCH] Add -fno-common where supported (WAF only) Normally under UNIX, uninitialized non-static global variables get placed in the "common" section, where they are merged at link time. This means if two C files define "int debug", they will end up referring to the same variable. Or if one does "float level" and the other does "int level" you'll get an accidental union. Such bugs can be hard to track down; fortunately GCC offers -fno-common to disable this feature. It didn't reveal any places which need fixing, however). Signed-off-by: Rusty Russell --- buildtools/wafsamba/samba_autoconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 174ca142102..207d7320b95 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -597,7 +597,7 @@ def SAMBA_CONFIG_H(conf, path=None): if Options.options.developer: # we add these here to ensure that -Wstrict-prototypes is not set during configure - conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes', + conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -fno-common', testflags=True) if os.getenv('TOPLEVEL_BUILD'): conf.ADD_CFLAGS('-Wcast-qual', testflags=True) -- 2.34.1