[cfe-dev] clang and gcc implement __PRETTY_FUNCTION__ differently

Eli Friedman eli.friedman at gmail.com
Wed Nov 30 18:32:08 PST 2011


On Wed, Nov 30, 2011 at 6:21 PM, Kostya Serebryany <kcc at google.com> wrote:
> Hi,
> Here is one difference between clang and gcc which makes some of our
> software fail when built with clang.
> is this something you would consider fixing?

No, we are not going to change the placement of the * in "const char *foo".

-Eli

> Thanks,
>
> --kcc
>
> % cat pretty.cc
> #include <stdio.h>
> template<class T>
> const char *foo() {
>   return __PRETTY_FUNCTION__;
> }
> int main() {
>   printf("%s\n", foo<int>());
> }
> % g++ pretty.cc && ./a.out
> const char* foo() [with T = int]
> % ~/llvm/build/Release+Asserts/bin/clang++ pretty.cc && ./a.out
> const char *foo()
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list