aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authormerrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4>1996-05-06 18:36:48 +0000
committermerrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4>1996-05-06 18:36:48 +0000
commit9493f1421183f7c39598629fe60d37c599dfe2af (patch)
treebe78d9090c203f4f4af7523158cd4c1fe16087a4 /gcc/c-decl.c
parent37e76d7d025cb2be196ea36958eab50350edc597 (diff)
-fno-common change
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11940 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 38c25eba6af..e031546960c 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3611,9 +3611,13 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (TREE_CODE (decl) == FUNCTION_DECL)
gen_aux_info_record (decl, 0, 0, TYPE_ARG_TYPES (TREE_TYPE (decl)) != 0);
- /* For C and Objective-C, we by default put things in .common when
- possible. */
- DECL_COMMON (decl) = 1;
+ /* ANSI specifies that a tentative definition which is not merged with
+ a non-tentative definition behaves exactly like a definition with an
+ 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)
+ DECL_COMMON (decl) = 1;
/* Set attributes here so if duplicate decl, will have proper attributes. */
decl_attributes (decl, attributes, prefix_attributes);