Subject: Re: gcc Q - a bit off topic
To: Bill Studenmund <skippy@macro.stanford.edu>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 10/21/1997 20:47:58
On Tue, 21 Oct 1997 18:15:31 -0700 (PDT) 
 Bill Studenmund <skippy@macro.stanford.edu> wrote:

 > I want to turn the call to the addref and delref functions into macros,
 > and print out what source file they were called from. Does anyone know how
 > to do this? I.E. is there a variable in gcc which is the name of the
 > source file being compiled? Or anything else which would help?

__FILE__ is "../../../path/to/file.c" and __LINE__ is an integer line
number.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-6                                       Work: +1 415 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939