From: simonb Date: Sat, 26 Apr 2008 16:59:38 +0000 (+0000) Subject: PR c/35652 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e3b64b4fe86e3bdceb004b797f6da883402a2ef;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 843a2e232df4..6453c5033550 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-04-26 Simon Baldwin + + PR c/35652 + * builtins.c (c_strlen): Suppressed multiple warnings that can occur + with propagated string constants. + 2008-04-26 Uros Bizjak * config/i386/i386.md (fix_trunc_i387_fisttp_with_temp): Use 'X' diff --git a/gcc/builtins.c b/gcc/builtins.c index 765294b1be33..321032dace02 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; }