This is the mail archive of the gcc@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]

Re: C99 usage in gcc



> >> > #ifdef __cplusplus
> >> > // foo
> >> > #endif

Joe Buck <Joe.Buck@synopsys.COM> writes:
> > I disagree.  There should be no warning, because the plain-C89 compiler
> > will *not* misinterpret this file.  True, the // will not be interpreted
> > as a comment; since there is no token "//" in C89 it will be interpreted
> > as two / tokens.  Nevertheless, the token stream with the two / tokens is
> > ifdef'ed out, so it's a don't care.

On Mon, Feb 02, 2004 at 03:40:10PM -0800, Zack Weinberg wrote:
> That is true, however, there are other constructs that *will* be
> misinterpreted: for example,
> 
> #ifdef __cplusplus
> // can't happen
> #endif
> 
> It is too hard to tell the difference at the point where the warning
> issues.

But -pedantic issues no warning for this case either, if // is changed to
/ /.  Do you consider that a bug?


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