This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/14520] [3.3 only] fixincludes mishandles comment containing #include in stdlib.h
- From: "jifl-bugzilla at jifvik dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2004 16:19:45 -0000
- Subject: [Bug bootstrap/14520] [3.3 only] fixincludes mishandles comment containing #include in stdlib.h
- References: <20040311050851.14520.jifl-bugzilla@jifvik.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jifl-bugzilla at jifvik dot org 2004-03-11 16:19 -------
One assumes this is a fix for a problem with a specific header from a specific
OS, so on the face of it we don't need to generalise it for all possible ways it
could occur. I've seen spaces between the # and include more often than
comments at the start, for example. We can't really reimplement the cpp parser
in regexp :-).
So if the system header this was intended to fix doesn't use comments there,
which is most likely, then there would be no problem, even though it's permitted
by the preprocessor's syntax strictly. It's an obsolete OS of course, so it's de
facto impossible to tell though. I think I could reasonably argue for throwing
caution to the wind in this one instance ;-).
However your point may be more relevant for the other regexps matching #include.
The alternative would be to implement some extra phase to fix-header.c
specifically to excise comments, to avoid any problems.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14520