[...@gnu-6 pr43379]$ cat y.c
void *foo(void)
{
lab:
  return &&lab;
}
[...@gnu-6 pr43379]$ gcc -S y.c
y.c: In function ‘foo’:
y.c:4: warning: function returns address of local variable
[...@gnu-6 pr43379]$ 

A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00704.html


-- 
           Summary: Gcc warns label as local variable
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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

Reply via email to