Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Please specify if you need the real name or just want to be able to distinglish calls from different functions. Also, if it can be hardware specific. Commented Aug 8, 2010 at 12:10
  • 4
    If your problem with __FUNCTION__ is that it's not portable, note that many compilers have a similar feature, just sometimes with a different name. It's been standardized to __func__ in C99. Commented Aug 8, 2010 at 13:04
  • 3
    __FUNCTION__ and __func__ don't actually use the preprocessor (because the preprocessor does not understand C syntax and can't identify function declarations). In effect they're compiler intrinsics. Proof: run gcc -E on the code, look at the output. Commented Aug 8, 2010 at 16:00