Re: elog with automatic file, line, and function

Поиск
Список
Период
Сортировка
От Ian Lance Taylor
Тема Re: elog with automatic file, line, and function
Дата
Msg-id siy9u11dpj.fsf@daffy.airs.com
обсуждение исходный текст
Ответ на elog with automatic file, line, and function  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: elog with automatic file, line, and function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> > Additionally, C99 (and GCC for a while) would allow filling in the
> > function name automatically.
> 
> We could probably treat the function name as something that's optionally
> added to the file/line error report info if the compiler supports it.
> 
> BTW, how does that work exactly?  I assume it can't be a macro ...

It's a macro just like __FILE__ and __LINE__ are macros.

gcc has supported __FUNCTION__ and __PRETTY_FUNCTION__ for a long time
(the latter is the demangled version of the function name when using
C++).

Ian


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

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: More on elog and error codes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: More on elog and error codes