This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Debugging information in C macros


> From: raselmsh@hotmail.com
> > From: basile@starynkevitch.net
> > On Tue, 10 May 2011 17:33:57 +0200
> > Michael T wrote:
> > > I was wondering if it is possible to improve the debugging information
> > > generated by gcc when resolving C macros? Just as an example, when I
> > > preprocessed the following C file:
[...]
> > Besides, I believe that there are lots of actual C code which depends
> > upon that behavior. Code like
> > #define my_fatal_at(Msg,Line) do { \
> > printf ("%s:%d fatal error: %s\n", __FILE__, Line, Msg); \
> > abort (); \
> > } while(0);
[...]
> Sadly that sounds rather convincing.  Thanks for the answer and sorry for the noise.

Although thinking about it, __FILE__ and __LINE__ are also handled by the
preprocessor, so they need not be affected by "#" lines.? I'm sure there must be
a reason though why gcc isn't doing this already.

Regards,

Michael
 		 	   		  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]