]> granicus.if.org Git - postgresql/commit
Use -fwrapv in CFLAGS if we are using a version of gcc that accepts this flag.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Mar 2008 21:50:23 +0000 (21:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Mar 2008 21:50:23 +0000 (21:50 +0000)
commit899b9c3e044b0cab8ef4d1fbd48f0c012162801f
tree28b34b2c46967a9ae7db59a40a055bbfa8207cea
parentd19d35431bf05508bbfb59732222133f862a5d36
Use -fwrapv in CFLAGS if we are using a version of gcc that accepts this flag.
This prevents compiler optimizations that assume overflow won't occur, which
breaks numerous overflow tests that we need to have working.  It is known
that gcc 4.3 causes problems and possible that 4.1 does.  Per my proposal
of some time ago and a recent report from Kris Jurka.

Backpatch as far as 8.0, which is as far as the patch conveniently goes.
7.x was pretty short of overflow tests anyway, so it may not matter there,
even assuming that anyone cares whether 7.x builds on recent gcc.
configure
configure.in