Re: Should --enable-debug set CFLAGS to -O0 instead of -O2? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Should --enable-debug set CFLAGS to -O0 instead of -O2?
Date
Msg-id 2192626.1754021223@sss.pgh.pa.us
Whole thread Raw
In response to Re: Should --enable-debug set CFLAGS to -O0 instead of -O2?  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Should --enable-debug set CFLAGS to -O0 instead of -O2?
List pgsql-hackers
Chao Li <li.evan.chao@gmail.com> writes:
> Thanks for the explanation. W.R.T the PROFILE variable, I tried:

> # ./configure --enable-debug
> # PROFILE="-O0" make

> As a result, both "-O2" and "-O0" presented to gcc. In that case, I believe
> "-O0" will be ignored by gcc.

Nope ... read the gcc docs, or experiment.  The last -O switch wins.
(This is true for most switches in most Unix tools, and it's common
for scripts such as Makefiles to rely on it.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Should --enable-debug set CFLAGS to -O0 instead of -O2?
Next
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences