Question about -Wstrict-overflow=2

Alexander Motzkau
Sat Mar 6 12:03:24 GMT 2021

Andrew Haley wrote:
> The compiler is telling you that it's assuming that expbuf + 120
> does not wrap around. There's nothing really mysterious about it.

But should that warning only occur on -Wstrict-overflow=3 or higher?
Why does it occur on -Wstrict-overflow=2?

I usually compile my software with -Werror (so that warnings won't be
ignored anymore) and so this information from the compiler broke the build
when going from GCC 8 to GCC 9. It seems -Wstrict-overflow=2 there is not
fit to be used with -Werror anymore. Am I correct?

Best regards,

More information about the Gcc-help mailing list