Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!amdcad!lll-crg!topaz!uwvax!puff!Thomas From: tom@puff.wisc.edu (Thomas Scott Christiansen) Newsgroups: net.lang.c Subject: Re: How about a predefined #FILE, #PATH and #FUNCTION for C? Message-ID: <592@puff.UUCP> Date: Mon, 27-Jan-86 09:23:13 EST Article-I.D.: puff.592 Posted: Mon Jan 27 09:23:13 1986 Date-Received: Wed, 29-Jan-86 04:08:02 EST References: <313@yale.ARPA> <312@yale.ARPA> Sender: tom@puff.UUCP Organization: University of Wisconsin Systems Lab Lines: 12 On most compilers with a CPP, you have the symbols __FILE__ and __LINE__ defined. Consider the following error macro: #define ERROR(function, argument, excuse) \ { \ fprintf(stderr,"Unexpected ERROR at line %d of file \"%s\"\n", \ __LINE__, __FILE__ ); \ fprintf(stderr,"function: %s() died (%s) from \"%s\"\n", \ function, argument, excuse); \ } tom