From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Schweikhardt To: eggert@twinsun.com (Paul Eggert) Cc: schweikh@diamant.noc.dfn.de, gcc2@cygnus.com, egcs@cygnus.com Subject: Re: #line directive bug Date: Tue, 24 Feb 1998 03:09:00 -0000 Message-id: <199802241108.MAA25719@obsidian.noc.dfn.de> References: <199802241036.CAA26361@shade.twinsun.com> X-SW-Source: 1998-02/msg01105.html Paul, # From: schweikh@diamant.noc.dfn.de (Jens Schweikhardt) # Date: 23 Feb 1998 10:08:57 GMT # Message-ID: <6crhrp$71$2@stuttgart.shuttle.de> # # #line 42 "foo\0bar" # # Thanks for the bug report. That "\0" causes cpp to expand __FILE__ # incorrectly, which means GCC silently generates incorrect code. # I enclose a patch below, relative to the latest cccp.c snapshot. Thanks for the quick response. I'm always impressed when I get fixes for my bug reports the next day. The FreeBSD folks are great as well :-) # This patch fixes only the preprocessor. Even with the patch, cc1 still # outputs just "foo" for the file name in diagnostics; it should output # "foo" followed by a NUL byte followed by "bar". This is a bug, but # it's a pain to fix and it's lower priority since it merely affects # diagnostics and debugging info. I wouldn't be surprised if most back # ends can't handle NUL bytes in file names, as POSIX doesn't allow # NULs in file names, so it might be best just to leave cc1 alone. Well, I think I could live with that. Gcc was not the only compiler I had trouble with. The Solaris SparcWorks compiler also has (another) problem with line directives and IRIX c89 has yet another. Trying to get someone from Sun to listen to me is a tricky excercise :-( Thanks again for a great compiler. Keep up the good work. I'll read you in comp.std.c. Regards, -- Jens Schweikhardt http://www.shuttle.de/schweikh/ SIGSIG -- signature too long (core dumped)