Re: elog with automatic file, line, and function - Mailing list pgsql-hackers

From Ian Lance Taylor
Subject Re: elog with automatic file, line, and function
Date
Msg-id siy9u11dpj.fsf@daffy.airs.com
Whole thread Raw
In response to elog with automatic file, line, and function  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: elog with automatic file, line, and function  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Philip Warner
Date:
Subject: Re: More on elog and error codes
Next
From: Tom Lane
Date:
Subject: Re: More on elog and error codes