This one bit me today

Scott Amspoker scott at bbxsda.UUCP
Fri Oct 20 01:46:14 AEST 1989


Scott Amspoker writes:

>>>>Another easy pitfall in C is forgetting to close a comment.  On compilers
>>>>that don't nest comments this will cause some code to be swallowed up

I was incorrect in my above comment.  Nested comments have *nothing* to
do with it.

Bob Goudreau writes:

>>>Any compiler that allows nesting of comments isn't a C compiler anyway,
>>>by either K&R or ANSI standards.

Scott Amspoker writes (FYI):

>>Believe it or not - that is a command line switch on some C compilers.

Bob Goudreau writes:

>My point was that any such compilers (or compiler-instantiations created
>by invoking the same program with different switches) may *claim* to be
>C compilers, but claiming isn't enough.  Such compilers are *broken*, at
>least as C compilers.
>[...]

I don't get it.  Are you saying that a C compiler that allows the option
of nested comments is *broken*?  I believe Turbo C has a nested comments
option.  I agree that a compiler that insists on nesting comments is
probably non-conforming (I say "probably" because I can't recite the
actual ANSI text at this moment).  But what's wrong with command line
options that allow various enhancements?

-- 
Scott Amspoker
Basis International, Albuquerque, NM
(505) 345-5232
unmvax.cs.unm.edu!bbx!bbxsda!scott



More information about the Comp.lang.c mailing list