[Bug c/37259] New: spurious warning on correct code

tromey at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 27 19:22:00 GMT 2008


Consider this code:

int f1 (char *, char **);

int f2 (char *result)
{
  return f1 (++result, &result);
}


If I compile it with -Wall I get a warning:

opsy. gcc -Wall -c b.c
b.c: In function ‘f2’:
b.c:5: warning: operation on ‘result’ may be undefined

However, I don't think this is undefined.

This is a regression since 4.3.


-- 
           Summary: spurious warning on correct code
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list