https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475
Harald van Dijk <harald at gigawatt dot nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |harald at gigawatt dot nl --- Comment #60 from Harald van Dijk <harald at gigawatt dot nl> --- (In reply to Marian from comment #59) > Thanks for the fast replay > > wget http://ptrace.fefe.de/int.c > gcc -Wstrict-overflow=1 -Wall -Wextra -pedantic -o int int.c > > does not produce a warning (except for the missing `#include <stdio.h>`) on > gcc 8.2.0 on Alpine Linux for me, nor on GCC 8.2.1 20181127 an Arch Linux. It warned at -O2 -Wall with GCC 4.2 to 7 (-O2 enabling -fstrict-overflow), but stopped warning in GCC 8. Warnings no longer being emitted in cases where they are desired is part of bug 80511. The GCC 8 Changes page[*] says -Wstrict-overflow is deprecated (even if it is supposed to still work) and recommends to use -fsanitize=signed-integer-overflow to get a run-time warning, which does catch this. [*] https://gcc.gnu.org/gcc-8/changes.html