https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119005
--- Comment #3 from Alejandro Colomar <alx at kernel dot org> --- Hmmm, thinking twice, I guess it is not a false positive. I can rewrite to something similar, which avoids the overflow, and avoids the diagnostic: alx@debian:~/tmp$ cat foo.c #include <limits.h> int f(void) { static int i = 0; if (i >= 2) return -1; i++; return 0; } Thanks!