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
This commit is contained in:
Simon Baldwin 2008-04-26 16:59:38 +00:00 committed by Simon Baldwin
parent 73e8165a68
commit 6bfb7f1068
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-04-26 Simon Baldwin <simonb@google.com>
PR c/35652
* builtins.c (c_strlen): Suppressed multiple warnings that can occur
with propagated string constants.
2008-04-26 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (fix_trunc<mode>_i387_fisttp_with_temp): Use 'X'

View File

@ -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;
}