From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Booth To: Ross Combs Cc: martin@loewis.home.cs.tu-berlin.de, gcc@gcc.gnu.org Subject: Re: Compiler Directive to List Defined Macros? Date: Fri, 30 Jun 2000 01:36:00 -0000 Message-id: References: <200006292249.QAA30985@quito.cs.nmsu.edu> X-SW-Source: 2000-06/msg00793.html Ross Combs wrote:- > Hmm. That is how I originally tried to use it. It is also annoying that > I couldn't find a way to stringize __LINE__ and then concatenate it to > __FILE__. But such things can be worked around. You mean to get output like "\"myfile.c\": 200"? If so, the following should work: #define str(x) #x #define xstr(x) str(x) xstr(__FILE__: __LINE__) Or if you want "myfile.c: 200", i.e. without the inner quotes, try __FILE__ ": " xstr(__LINE__) If you don't understand why this works, info cpp should help. If it doesn't, please help us to improve the docs! Neil.