* c-decl.c (start_decl): Initialized variables are not common.
From-SVN: r50250
This commit is contained in:
parent
2a85660dc2
commit
cc2c33286f
@ -3476,7 +3476,7 @@ start_decl (declarator, declspecs, initialized, attributes)
|
||||
initializer equal to zero. (Section 3.7.2)
|
||||
-fno-common gives strict ANSI behavior. Usually you don't want it.
|
||||
This matters only for variables with external linkage. */
|
||||
if (! flag_no_common || ! TREE_PUBLIC (decl))
|
||||
if (!initialized && (! flag_no_common || ! TREE_PUBLIC (decl)))
|
||||
DECL_COMMON (decl) = 1;
|
||||
|
||||
/* Set attributes here so if duplicate decl, will have proper attributes. */
|
||||
|
5
gcc/testsuite/gcc.c-torture/compile/20020303-1.c
Normal file
5
gcc/testsuite/gcc.c-torture/compile/20020303-1.c
Normal file
@ -0,0 +1,5 @@
|
||||
/* With -fzero-initialized-in-bss, we made I a common symbol instead
|
||||
of a symbol in the .bss section. Not only does that break semantics,
|
||||
but a common symbol can't be weak. */
|
||||
|
||||
int i __attribute__((weak)) = 0;
|
Loading…
Reference in New Issue
Block a user