Re: elog with automatic file, line, and function

From: Ian Lance Taylor <ian(at)airs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: elog with automatic file, line, and function
Date: 2001-03-20 00:33:28
Message-ID: siy9u11dpj.fsf@daffy.airs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-03-20 00:35:22 Re: More on elog and error codes
Previous Message Philip Warner 2001-03-19 23:48:55 Re: More on elog and error codes