This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix C++/14329, badly formatted warnings for SRA replacements used uninitialized


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]