The GCC "End of Text Line" Bug
Andi Kleen
ak-uu@muc.de
Wed Feb 16 04:58:00 GMT 2000
mikex.polehn@intel.com (Polehn, MikeX) writes:
> The GCC "End of Text Line" Bug
[...]
What has cost me some time in the past:
gcc 2.95 generates strange syntax errors when you have a pragma
followed by \r\n. This happens often when porting DLL code from
Windows to Unix. It seems the \r is copied over to the .i file, and
cc1 cannot cope with it. cc1 seems to mislex the next token
then. Fortunately it has been already fixed in gcc-current. It would
be nice if a similar fix could be incorporated into the
gcc-2.95-stable tree for an eventual 2.95.3 release. The annoyance is
that these bogus "syntax errors" are hard to track down if you don't
know about the #pragma bug. egcs-1.1 has the same problem.
Test case: (at the end of the pragma line is a ^M. Readd it if the
mailer removed it or use the uuencoded version)
typedef int test_t;
#pragma unknown
test_t bla(void)
{
}
(same uuencoded)
begin 664 t18.c
M='EP961E9B!I;G0@=&5S=%]T.R`*"B-P<F%G;6$@=6YK;F]W;@T*"@IT97-T
17W0@8FQA*'9O:60I"GL*?0H`
`
end
% /pkg/gcc-2.95/bin/gcc -v
Reading specs from /pkg/gcc-2.95.1/lib/gcc-lib/i686-unknown-linux/2.95.1/specs
gcc version 2.95.1 19990816 (release)
% /pkg/gcc-2.95/bin/gcc -c t18.c
t18.c:7: parse error before `{'
(older gcc-current snapshot):
% /pkg/gcc-000102/bin/gcc -v
Reading specs from /pkg/gcc-000102/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000102 (experimental)
% /pkg/gcc-000102/bin/gcc -c t18.c
%
-Andi
--
This is like TV. I don't like TV.
More information about the Gcc-bugs
mailing list