pgsql: Use -fwrapv in CFLAGS if we are using a version of gcc that - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Use -fwrapv in CFLAGS if we are using a version of gcc that
Date
Msg-id 20080310215033.0A0CA753F33@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql:
        configure.in (r1.490.2.15 -> r1.490.2.16)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/configure.in?r1=1.490.2.15&r2=1.490.2.16)
        configure (r1.523.2.13 -> r1.523.2.14)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/configure?r1=1.523.2.13&r2=1.523.2.14)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Use -fwrapv in CFLAGS if we are using a version of gcc that
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Use -fwrapv in CFLAGS if we are using a version of gcc that