Re: [patch] __func__ -> __FUNCTION__

From: Muli Ben-Yehuda (mulix@actcom.co.il)
Date: Tue Aug 13 2002 - 03:19:46 EST


On Tue, Aug 13, 2002 at 01:19:07AM -0700, H. Peter Anvin wrote:
>
> But it won't work on a compiler that actually *supports* __func__...
>
> I think that is gcc 3.1 or higher, but I'm not the authority...

Again, works for me.

http://home.tiscalinet.ch/t_wolf/tw/c/c9x_changes.html (search for
__func__) would seem to imply that you are correct, though. Perhaphs
someone more knowledgable about gcc could shed some light?

mulix@tea:~/tmp$ cat foo.c
#include <stdio.h>

#if DEF_FUNC
#ifndef __func__
#define __func__ __FUNCTION__
#endif /* !defined __func__ */
#endif /* DEF_FUNC */

int main()
{
        printf("%s\n", __func__);
        return 0;
}
mulix@tea:~/tmp$ gcc3 -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --enable-threads
--enable-languages=c,c++
Thread model: posix
gcc version 3.1
mulix@tea:~/tmp$ gcc3 foo.c -DDEF_FUNC=1 -o foo
mulix@tea:~/tmp$ ./foo
main
mulix@tea:~/tmp$ gcc3 foo.c -DDEF_FUNC=0 -o foo
mulix@tea:~/tmp$ ./foo
main
mulix@tea:~/tmp$

> >ObCompleteyUnrelatedQuestions: where can I find klibc?
>
> ftp://ftp.kernel.org/pub/linux/libs/klibc/

Much obliged.

-- 
"Hmm.. Cache shrink failed - time to kill something?
 Mhwahahhaha! This is the part I really like. Giggle."
					 -- linux/mm/vmscan.c
http://vipe.technion.ac.il/~mulix/	http://syscalltrack.sf.net


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 22:00:31 EST