Skip site navigation (1) Skip section navigation (2)

Anyone for adding -fwrapv to our standard CFLAGS?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Anyone for adding -fwrapv to our standard CFLAGS?
Date: 2005-12-12 21:19:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
It seems that gcc is up to some creative reinterpretation of basic C
semantics again; specifically, you can no longer trust that traditional
C semantics of integer overflow hold:

While I don't think we are anywhere using exactly the same trick that
the referenced mysql code is using, it certainly seems likely to me that
a compiler that is willing to replace "x < 0 && -x < 0" with "false"
might be able to break some of the integer overflow checks we do use.

I think we need to add -fwrapv to CFLAGS anytime the compiler will take
it, same as we recently started doing with -fno-strict-aliasing.


			regards, tom lane


pgsql-hackers by date

Next:From: Jim C. NasbyDate: 2005-12-12 21:36:41
Subject: Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508 digits
Previous:From: Cristian PrietoDate: 2005-12-12 21:18:29
Subject: replan needed?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group