aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-02-27 15:20:28 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-02-27 15:20:28 -0500
commit700942a0c60bb556ac7c35f57d4f559e671e0c66 (patch)
tree701084484f9d0595b32a870afe626251b1c29a91 /gcc/c-common.c
parent739d15ab1771aff57c8601b4256a40de131cc975 (diff)
downloadgcc-700942a0c60bb556ac7c35f57d4f559e671e0c66.zip
gcc-700942a0c60bb556ac7c35f57d4f559e671e0c66.tar.gz
gcc-700942a0c60bb556ac7c35f57d4f559e671e0c66.tar.bz2
(declare_hidden_char_array): Build new type if warn_larger_than.
From-SVN: r6654
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 627dc00..b71a425 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -67,13 +67,13 @@ declare_hidden_char_array (name, value)
int vlen;
/* If the default size of char arrays isn't big enough for the name,
- make a bigger one. */
+ or if we want to give warnings for large objects, make a bigger one. */
vlen = strlen (value) + 1;
type = char_array_type_node;
- if (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TREE_TYPE (type))) < vlen)
+ if (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TREE_TYPE (type))) < vlen
+ || warn_larger_than)
type = build_array_type (char_type_node,
build_index_type (build_int_2 (vlen, 0)));
-
push_obstacks_nochange ();
decl = build_decl (VAR_DECL, get_identifier (name), type);
TREE_STATIC (decl) = 1;