This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: question about -Werror=strict-overflow
- From: Ian Lance Taylor <iant at google dot com>
- To: JÄdrzej Dudkiewicz <jedrzej dot dudkiewicz at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 17 May 2011 07:36:03 -0700
- Subject: Re: question about -Werror=strict-overflow
- References: <BANLkTikqqEOHOsmTRFQRubzLWQMi-tkuOg@mail.gmail.com>
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