This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/14342] cpp -C -dD loses comments on same line as #define directives


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]