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