Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3 - Mailing list pgsql-hackers

From Kris Jurka
Subject Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3
Date
Msg-id Pine.BSO.4.64.0803100214130.24272@leary.csoft.net
Whole thread Raw
In response to Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On Mon, 10 Mar 2008, Tom Lane wrote:

> I am wondering if these checks have been no-ops in Postgres builds done 
> with gcc 4.1 and up, and we're only just now being told about it.
>

Since gcc 4.2 supports -Wstrict-overflow, I rebuilt pg with that to see 
what it's doing currently.  I'm not sure what -Wstrict-overflow level 
-Wall implies with gcc 4.3, but I cranked it up to 5 on 4.2 to get the 
most details out of it.  I don't see any of the warnings I saw on 4.3 and 
I get the attached list which looks less dangerous spot checking a couple 
items, but I haven't gone through the whole list.

Additionally the comments in the blog posting[1] I linked to previously, a 
user asks, "how come I don't see any warnings with -Wstrict-overflow on 
gcc 4.2.3" and it's answered "I think the full effects only come in on gcc 
mainline. At least, gcc 4.2 does not eliminate the loop, but gcc 4.3 
will."  So clearly 4.3 is doing something new here, but that doesn't prove 
we're safe on previous versions.

[1] http://www.airs.com/blog/archives/120

Kris Jurka

pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Include Lists for Text Search
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Lazy constraints / defaults