This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/14342] cpp -C -dD loses comments on same line as #define directives
- From: "amb at gedanken dot demon dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 06:21:18 -0000
- Subject: [Bug preprocessor/14342] cpp -C -dD loses comments on same line as #define directives
- References: <20040229093928.14342.amb@gedanken.demon.co.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From amb at gedanken dot demon dot co dot uk 2004-03-03 06:21 -------
There are now two options in gcc that control how comments that follow a #define
on the same line are output:
-C which ignores the comment totally
-CC which outputs the comment on the -dD output line and everywhere that the
#defined macro is used.
There is no solution that produces the gcc v2.95 output of producing the comment
only on the -dD output line and not where the macro is used.
The cxref program (http://www.gedanken.demon.co.uk/cxref/) uses comments as
documentation for C programs and it uses gcc as the C pre-processor so that it
has valid C code to examine. The problem is that it is now not possible to use
the documentation comment that follows a #define as documentation for it. Using
-C the comment is not seen and using -CC it appears in more than one place
giving incorrect documentation elsewhere.
The combination of -C and -dD is specific enough (and uncommon enough) that
going back to the old behaviour (which has been there since 1997) shouldn't
break anything.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14342