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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
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-19 23:45:57
Message-ID: 200702192345.l1JNjv629573@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to developer's FAQ:

<P><I>src/Makefile.custom</I> can be used to set environment variables,
like <I>CUSTOM_COPT</I>, that are used for every compile.

---------------------------------------------------------------------------

Magnus Hagander wrote:
> >> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-02-19 23:50:30 Re: TopPlan, again
Previous Message Simon Riggs 2007-02-19 23:10:47 Re: Multiple Storage per Tablespace, or Volumes