Skip site navigation (1) Skip section navigation (2)

Re: --enable-debug does not work with gcc

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, NikhilS <nikkhils(at)gmail(dot)com>, Gavin Sherry <swm(at)alcove(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: --enable-debug does not work with gcc
Date: 2007-02-02 18:43:39
Message-ID: 45C3865B.1080000@hagander.net (view raw or flat)
Thread:
Lists: pgsql-hackers
>> If we did what you suggest, then --enable-debug would cause performance
>> degradation, which would cause people to not use it, which would result
>> in most binaries being completely undebuggable rather than only partially.
>> Doesn't sound like a good tradeoff to me.
>>
>> 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

//Magnus


In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2007-02-02 19:30:01
Subject: Re: Referential Integrity and SHARE locks
Previous:From: imadDate: 2007-02-02 18:40:05
Subject: Re: PL/pgSQL RENAME functionality in TODOs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group