[net.lang.c] How about a predefined #FILE, #PATH

aglew@ccvaxa.UUCP (01/29/86)

Aztec C on the IBM PC has the "predefined variable names"
__FILE__, __LINE__, __FUNC__, which are actually compile time
"constants" at any place in the code (macros work fine).

Combining these with the new standard for concatenation of string constants
made it easy to produce some half-decent error messages:

puts("Error in " __FUNC__ " at line " __LINE__ " of file " __FILE__);

Unfortunately, although this was described in the manual, it didn't work
in the version of the compiler we had.
I don't have a manual for the ANSI C standard, so I don't know if these
are included.

PS. If you really want to use #defines, something like this csh alias 
might be useful:

	alias CC	cc -DFILE=\!:1 \!:1.c -o \!:1

and a little lexer can do the required substitutions for line number and
function.