mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
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 <rusty@rustcorp.com.au>
This commit is contained in:
parent
14f99167f6
commit
3ccfe7cb7b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user