Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3

From: Kris Jurka <books(at)ejurka(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3
Date: 2008-03-10 06:35:55
Message-ID: Pine.BSO.4.64.0803100214130.24272@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Attachment Content-Type Size
gcc42-strict-overflow-warnings.txt text/plain 7.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-03-10 07:16:52 == Postgres Weekly News - March 09 2008 ==
Previous Message Oleg Bartunov 2008-03-10 06:34:51 Re: Include Lists for Text Search