Why is it so easy to override -fno-strict-aliasing?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Why is it so easy to override -fno-strict-aliasing?
Date: 2004-01-30 18:49:49
Message-ID: 17105.1075488589@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In config/c-compiler.m4 I read

if test "$ac_env_CFLAGS_set" != set; then
CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
fi

This means that a configure operation as innocuous-looking as

CFLAGS="-O3" ./configure

will break the build on gcc >= 3.3 because it will fail to supply
-fno-strict-aliasing. I claim this is a lousy idea. We should drop
the if-test and always add -fno-strict-aliasing if the compiler
will take it. People who *really* know what they are doing can
experiment with removing the switch from Makefile.global after
configure, but I don't think it should be quite this easy to lose it.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-01-30 19:06:05 Re: Why is it so easy to override -fno-strict-aliasing?
Previous Message Tom Lane 2004-01-30 17:51:16 Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint