Search code examples
cconventionsc-preprocessor

What is __FUNCT__ for?


I was looking at some PETSc example code, and I came across this snippet:

#undef __FUNCT__
#define __FUNCT__ "main"

right before main begins.

Is setting __FUNCT__ or something like it before every function (or just main?) a standard C programming convention?

If so, why is this done?


Solution

  • This appears to be shorthand or a work-around for a C compiler that doesn't support the __FUNCTION__ standard macro.