This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question about -Werror=strict-overflow


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]