gcc and g++ (all the versions I've ever used) don't give unused variable
warnings in a lot of cases where there are unused variables. Simple sample
code:

int test1 ()
{
  int x = 3;
  return (2);
}

int test2 ()
{
  int x;
  x = 3;
  return (2);
}

They only give an unused variable warning in test1 function. They should warn
in both cases.


-- 
           Summary: Unused variable warning should be more useful
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jmfo1982 at yahoo dot es


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36390

Reply via email to