Re: compiler warnings with gcc 4.8 and -Og

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: compiler warnings with gcc 4.8 and -Og
Дата
Msg-id 20220602150430.5ewy3ustj3eqrcl5@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: compiler warnings with gcc 4.8 and -Og  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: compiler warnings with gcc 4.8 and -Og  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

On 2022-06-02 10:33:52 -0400, Tom Lane wrote:
> Matthias van de Meent <boekewurm+postgres@gmail.com> writes:
> > On Thu, 2 Jun 2022, 07:10 Tom Lane, <tgl@sss.pgh.pa.us> wrote:
> >> I'm a little dubious about whether -Og is a case we should pay special
> >> attention to?
> 
> > The "Developer FAQ" page on the wiki suggests that when you develop
> > with gcc that you use CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"
> > during development, so I'd hardly call -Og "any random option".
> 
> I have no idea who wrote that FAQ entry, and I'd certainly not
> accept it as being project policy.

I don't know either. However:

> I'd actually say that's an excellent example of adding some random compiler
> options.

To me they mostly make sense. -g3 with -ggdb makes gcc emit enough information
about macros that the debugger can interpret them. -fno-omit-frame-pointer
makes profiling with call graphs much much smaller.

I tried to use -Og many times, but in the end mostly gave up, because it still
makes debugging harder compared to -O0.

Greetings,

Andres Freund



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: compiler warnings with gcc 4.8 and -Og
Следующее
От: Andres Freund
Дата:
Сообщение: Re: compiler warnings with gcc 4.8 and -Og