[cfe-dev] clang and gcc implement __PRETTY_FUNCTION__ differently

Matthieu Monrocq matthieu.monrocq at gmail.com
Wed Apr 11 09:52:04 PDT 2012


Le 10 avril 2012 22:15, Douglas Gregor <dgregor at apple.com> a écrit :

>
> On Apr 7, 2012, at 1:54 PM, Nikola Smiljanic <popizdeh at gmail.com> wrote:
>
> > Now with ref-qualifier support :)
> >
> > Note that -std=c++11 was added to the test file. I think this
> > shouldn't break anything, right (this is still a valid c++03 test)?
> > <pretty_function.txt>
>
>
> I've committed this as r154430, thanks!
>
>        - Doug
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>

Hello,

I have a question related to __PRETTY_FUNCTION__: how to get a "plain"
version of the function name ?

For logging, I'd really like to be able to automatically insert the
function name (class name and namespace names are bonus but not necessary).
For file name and line number it is easy, however __PRETTY_FUNCTION__ is
just too verbose to be used systematically (in template cases it's usually
twice as long as the logging message itself...).

Are there other macros available on gcc / Clang with a terser output ?

Regards.
-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120411/871b95d2/attachment.html>


More information about the cfe-dev mailing list