Forum Topic - GCC4.2.4 no longer defines the __func__ macro?:
   
GCC4.2.4 no longer defines the __func__ macro?  
Hi list,
does the gcc 4.2.4 no longer defines the __func__ macro?
I used that for debug/trace outputs within each function but it seems it diappeared in gcc4.2.4.
Re: GCC4.2.4 no longer defines the __func__ macro?  
Peter Weber wrote:
> Hi list,
> does the gcc 4.2.4 no longer defines the __func__ macro?
> I used that for debug/trace outputs within each function but it seems it diappeared in gcc4.2.4.

It is no longer treated as a macro but as a variable.

$ cat func.c
#include <stdio.h>

int foo() {
          printf("%s\n",__func__);
}

int main() {
         printf("%s\n",__func__);
         foo();
}

$ qcc -V4.2.4,gcc_ntox86 func.c
$ ./a.out
main
foo

Regards,

Ryan Mansfield
Re: GCC4.2.4 no longer defines the __func__ macro?  
so, things like that will no longer work right?

const char *fn = __func__ "hello";

not a big thing but rewriting all that stuff is a huge amount of work.

Thanks,
Peter
Re: GCC4.2.4 no longer defines the __func__ macro?  
Peter Weber wrote:
> so, things like that will no longer work right?
> 
> const char *fn = __func__ "hello";
> 
> not a big thing but rewriting all that stuff is a huge amount of work.

Correct. gcc is just following c99.

Regards,

Ryan Mansfield