diff options
author | simonb <simonb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-26 16:59:38 +0000 |
---|---|---|
committer | simonb <simonb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-26 16:59:38 +0000 |
commit | 7e3b64b4fe86e3bdceb004b797f6da883402a2ef (patch) | |
tree | be42a70c57c4ba202b13aeb1fbbd2c1fffeb1f0f /gcc/builtins.c | |
parent | 500d8ed25c3d12340898e5f236b7b6b40f147406 (diff) | |
download | gcc-7e3b64b4fe86e3bdceb004b797f6da883402a2ef.tar.gz |
PR c/35652
* builtins.c (c_strlen): Suppressed multiple warnings that can occur
with propagated string constants.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134714 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 765294b1be3..321032dace0 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -447,7 +447,12 @@ c_strlen (tree src, int only_value) runtime. */ if (offset < 0 || offset > max) { - warning (0, "offset outside bounds of constant string"); + /* Suppress multiple warnings for propagated constant strings. */ + if (! TREE_NO_WARNING (src)) + { + warning (0, "offset outside bounds of constant string"); + TREE_NO_WARNING (src) = 1; + } return NULL_TREE; } |