Re: --enable-debug does not work with gcc - Mailing list pgsql-hackers

From Matthias Luedtke
Subject Re: --enable-debug does not work with gcc
Date
Msg-id 45C4DC4C.3000006@gmx.de
Whole thread Raw
In response to Re: --enable-debug does not work with gcc  (Magnus Hagander <magnus@hagander.net>)
Responses Re: --enable-debug does not work with gcc
List pgsql-hackers
Hi all,

Magnus Hagander wrote:
>>> Personally, in my development tree I use a Makefile.custom containing
>>>
>>> # back off optimization unless profiling
>>> ifeq ($(PROFILE),)
>>>    CFLAGS:= $(patsubst -O2,-O1,$(CFLAGS))
>>> endif
>>>
>>> -O1 still generates "uninitialized variable" warnings but the code is a
>>> lot saner to step through ... not perfect, but saner.  It's been a
>>> workable compromise for a long time.  I don't recommend developing with
>>> -O0, exactly because it disables some mighty valuable warnings.
>> Agreed.  I use -O1 by default myself, unless I am doing performance testing.
>>
> Something for the developers FAQ perhaps? I confess I did not know of
> Makefile.custom :-D

I did not know, either, but would have been glad, had I found such info
a few weeks ago when I started digging into the pg source ;)

And while we are at it, how about some CFLAGS="-DOPTIMIZER_DEBUG"
sweetness for the debugging section in the Dev FAQ?

Are there any other macros that enable some more debug output? (Or is
there a place where all this has already been documented?)

Cheers,
Matthias



pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Referential Integrity and SHARE locks
Next
From: Andrew Dunstan
Date:
Subject: Re: \copy (query) delimiter syntax error