[gnu.gcc.bug] proposed preprocessor defined __FUNC__

Leisner.Henr@XEROX.COM (Marty) (04/29/89)

While seeing the preprocessor change  I'd figure I'd propose this.

I've used a number of Aztec C compilers (from Manx software systems) and
they had a builtin predefine called __FUNC__ which expanded to the  string
constant for the current C function name.

This allowed a nice way to stick in error messages without resorting to
__FILE__/__LINE__ combinations (which I've always found obscure).

Aztec had a combined preprocessor/parser, so this wasn't too hard for them
to do.  I'm not sure how hard it would be to add to gcc.

Any comments about the viability and usefulness of such a feature?
Any good ideas on how to implement it (if it was in the preprocessor, I
suppose the preprocessor would have to be able to parse C code and
determine the current function name).


marty
ARPA:	leisner.henr@xerox.com
GV:  leisner.henr
NS:  martin leisner:wbst139:xerox
UUCP:	hplabs!arisia!leisner