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]

question about -Werror=strict-overflow


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?


I'm using gcc-4.6.0 and warning appears as early as
-Wstrict-overflow=2 (there is still 3, 4 and 5 - I don't even want to
go there).

In preprocessed sources, this is: "if (iRv == 0)", so not rogue
#defines this time.
-- 
JÄdrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.


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