4.3 and 4.4 don't catch the pointer expression pointing to a local variable:
$ cat foo.c char *foo(void) { char a[2]; return a+1; } char *bar(void) { char a[2]; return a; } $ gcc-4.2 -S -Wall -Wextra -O3 foo.c foo.c: In function 'foo': foo.c:4: warning: function returns address of local variable foo.c: In function 'bar': foo.c:10: warning: function returns address of local variable $ gcc-4.3 -S -Wall -Wextra -O3 foo.c foo.c: In function 'bar': foo.c:10: warning: function returns address of local variable $ gcc -S -Wall -Wextra -O3 foo.c foo.c: In function 'bar': foo.c:10: warning: function returns address of local variable -- Summary: [4.3/4.4 Regression] return of local variable pointer Product: gcc Version: 4.3.4 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38957