Re: Patch - Debug builds without optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch - Debug builds without optimization
Дата
Msg-id 29585.1308233449@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch - Debug builds without optimization  (Florian Pflug <fgp@phlo.org>)
Ответы Re: Patch - Debug builds without optimization  (Florian Pflug <fgp@phlo.org>)
Re: Patch - Debug builds without optimization  (Greg Smith <greg@2ndQuadrant.com>)
Список pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> On Jun16, 2011, at 14:30 , Radosław Smogura wrote:
>> I'm sending following patch which disables optimization when --enable-debug is passed. It was nasty (for me, at
least)that debug build required passing of CFLAGS with -O0 to get nice traceable code.
 

> Unfortunately, with some compilers (gcc, I'm looking at you) you get
> considerably fewer warnings with -O0 than with -O1, even if you specify
> -Wall.

Yes.  There is *zero* chance of this being accepted, because it would
break a lot of warnings that developers need to see.

> I usually use -O1 for debug builds, these are usually still at least
> somewhat debuggable with gdb.

I tend to do that too, but I still think that folding it into
--enable-debug would be a mistake.  The normal assumption (at least when
using gcc) is that --enable-debug doesn't cost any performance.  We
would annoy many people, especially packagers, if that stopped being
true.

I could see providing some other nonstandard configure switch that
changed the default -O level ... but realistically, would that do
anything that you couldn't already do by setting CFLAGS, ie
./configure CFLAGS="-O0 -g"
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: pg_upgrade using appname to lock out other users
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Latch implementation that wakes on postmaster death on both win32 and Unix