question about -Werror=strict-overflow

Ian Lance Taylor iant@google.com
Tue May 17 16:11:00 GMT 2011


Jędrzej Dudkiewicz <jedrzej.dudkiewicz@gmail.com> writes:

> I see the following warning:
>
> "assuming signed overflow does not occur when simplifying conditional
> to constant"
>
> pointing to a line containing:
>
> if (iRv == SSLSOCK_S_SUCCEED)
>
> where:
>
> typedef signed int TInt32;
> TInt32 iRv;
> #define SSLSOCK_S_SUCCEED 0
>
> Is there any chance for overflow?

What that warning means is that gcc has somehow determined that that
comparison is either always true or always false.  That determination
was made under the assumption that no signed overflow occurred.  So the
issue is not on the line you have shown us; it's on the lines which set
iRv.

Ian



More information about the Gcc-help mailing list