diff options
author | Simon Baldwin <simonb@google.com> | 2008-04-26 16:59:38 +0000 |
---|---|---|
committer | Simon Baldwin <simonb@gcc.gnu.org> | 2008-04-26 16:59:38 +0000 |
commit | 6bfb7f1068b1ad3d3bacb4fac704994ce1b9eb9f (patch) | |
tree | be42a70c57c4ba202b13aeb1fbbd2c1fffeb1f0f /gcc/builtins.c | |
parent | 73e8165a686cc74e51e53d28770f6064297e4c80 (diff) | |
download | gcc-6bfb7f1068b1ad3d3bacb4fac704994ce1b9eb9f.zip gcc-6bfb7f1068b1ad3d3bacb4fac704994ce1b9eb9f.tar.gz gcc-6bfb7f1068b1ad3d3bacb4fac704994ce1b9eb9f.tar.bz2 |
re PR c++/35652 (offset warning should be given in the front-end)
PR c/35652
* builtins.c (c_strlen): Suppressed multiple warnings that can occur
with propagated string constants.
From-SVN: r134714
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 765294b..321032d 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; } |