http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59892
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |trippels at gcc dot gnu.org Resolution|--- |INVALID --- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- struct isci_host; struct isci_orom; struct isci_pci_info { struct isci_host *hosts[2]; struct isci_orom *orom; } v = {{(struct isci_host *)1,(struct isci_host *)1}, 0}; int printf(const char *fmt, ...); int isci_pci_probe() { int i; struct isci_host *isci_host; for (i = 0, isci_host = v.hosts[i]; i < 2 && isci_host; isci_host = v.hosts[++i]) { printf("(%d < %d) == %d\n", i, 2, (i < 2)); } return 0; } int main() { isci_pci_probe(); } When v.hosts[0] or v.hosts[1] is NULL the loop is fine, so there is no reason for a warning. The testcase is obviously invalid.