This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix C++/14329, badly formatted warnings for SRA replacements used uninitialized
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 03 Dec 2006 18:12:30 -0800
- Subject: Re: [PATCH] Fix C++/14329, badly formatted warnings for SRA replacements used uninitialized
- References: <1164722085.29420.41.camel@celery.andrew.com> <45738184.9060101@codesourcery.com>
On Sun, 2006-12-03 at 18:01 -0800, Mark Mitchell wrote:
> Andrew Pinski wrote:
> I don't understand that. RTH's patch used a local variable "t", and all
> references to "t" in his patch look correct. Since t goes out of scope
> at the end of the "}", why is using "t" wrong?
Because we have:
{
const char *result;
tree t = NULL;
#define next_tree (t = va_arg (*text->args_ptr, tree))
and then we use t below after the switch:
if (set_locus && t != NULL)
*text->locus = location_of (t);
So we shadow that variable t which means we never setup the locus
correctly.
Thanks,
Andrew Pinski