This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25294] [4.0/4.1/4.2 Regression] Bogus "unterminated comment" error from #pragma comment
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2005 08:47:36 -0000
- Subject: [Bug c++/25294] [4.0/4.1/4.2 Regression] Bogus "unterminated comment" error from #pragma comment
- References: <bug-25294-11833@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from mmitchel at gcc dot gnu dot org 2005-12-20 08:47 -------
The problem is that directives.c:do_pragma says:
/* Squirrel away the pragma text. Pragmas are
newline-terminated. */
However, as this example shows, simply saving the entire line is incorrect; we
have not already performed the Phase 3 elimination of comments at this point.
I don't see any good alternative other than to check for the specific case of a
comment starting on this line, and, if the comment is not ended before the end
of the line, treating the end of the pragma as occurring directly before the
comment, rather than at the end of the line.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25294