#line directive bug
Jens Schweikhardt
schweikh@noc.dfn.de
Tue Feb 24 03:09:00 GMT 1998
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)
More information about the Gcc
mailing list