Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion __FUNCTION__ ????
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Kalle Olavi Niemitalo  
View profile   Translate to Translated (View Original)
 More options 19 Oct 2001, 13:16
Newsgroups: comp.lang.c
From: Kalle Olavi Niemitalo <k...@iki.fi>
Date: 19 Oct 2001 15:12:38 +0300
Local: Fri 19 Oct 2001 13:12
Subject: Re: __FUNCTION__ ????

sob...@eudoramail.com (Sobhan Vezzu) writes:
>          I understood that __FUNCTION__ is a preprocessor macro, which
> will substitute a file name. Similar to __FILE__ and __LINE__.

__FUNCTION__ is a GCC-specific extension.  Please read the node
"Function Names" in the GCC Info file or "Function Names as Strings"
in the printed manual; it's all explained there.

>          1) I have written a small code, only for __FUNCTION__ it
> prints as unknown why?

__FUNCTION__ is not a preprocessor macro, because the preprocessor
does not know about functions.

C99 has a similar identifier __func__, which isn't a preprocessor
macro either.

>          2) Where do I get a list of all the preprocessor macros.

If you're using GCC on Unix, you can do this:

  gcc -E -dM -xc /dev/null

i.e., preprocess an empty file as C and list all defined macros when
finished.  Many of those macros are not in any standard.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google