This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Serious error-causing change in new CPP's -traditional behavior
On Mon, May 08, 2000 at 02:43:24PM -0700, Jason R Thorpe wrote:
> On Sat, May 06, 2000 at 12:18:29PM -0700, Zack Weinberg wrote:
> > You might try converting whichever file this is to ANSI macro syntax.
> > Support for preprocessing assembly language in nontraditional mode has
> > been improved a lot recently.
>
> Yah, eventually, I'd like to do that. However, since I know the code in
> question is being built with at least 3 different versions of the compiler
> right now (EGCS 1.1.2 release, a hacked GCC 2.95.2, and gcc-current), I'd
> prefer to leave it as-is, at least until the next official release of
> GCC.
That's fair.
> > Right now, comments in a #define line are silently discarded
> > irrespective of -C, and I'm not sure what happens to comments in the
> > arguments of a macro (probably the same thing). I've never heard of
> > -CC before, but I'd be inclined to make that the behavior of -C. What
> > does your -C do with comments in the macro definition?
>
> Okay, using EGCS-1.1.2 plus the -CC option (who's description in the
> manpage I quoted seems to be a bit misleading) added by Christos Zoulas
> to that compiler's cccp, here is the output of the following test case:
...
> dr-evil:thorpej 144$ /usr/libexec/cpp -lang-c -CC cpp-comments.c
> # 1 "cpp-comments.c"
> /* This is a comment. *//*CONSTCOND*/
>
>
>
>
>
>
> void func(int arg)
> {
>
> do { /* This is a comment. */ if (( arg ) > 0) foo(( arg )); } while (/*CONSTCOND*/0) ;
> }
Hmm. Could you live with the comments inside #defines not appearing
in the location of the #define?
zw