Lisp-style comments

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Apr 29 16:55:31 AEST 1989


In article <1338 at ns.network.com> ddb at ns.UUCP (David Dyer-Bennet) writes:
>Was it perhaps discussed or proposed, and finally turned down after feature
>freeze on those particular compilers?

Certainly //comment-to-end-of-line was proposed and discussed, but it
was never accepted for inclusion in the C standard because it never
was considered part of the official C language by anybody we know of.
One comment style is sufficient.

I first saw //comments supported by a C compiler in use at the Naval
Postgraduate School, and I thought it was sufficiently useful that
I added it to Geotronics Corp's PDP-11 C compiler and preprocessor.
It was useful all right, but when we had to upgrade to a VAX its C
compiler and preprocessor did not like our //comments.  Therefore I
was faced with the choice of insisting that every C compiler we ever
wanted to use be modified to support //comments, or else convert all
our source code into genuine //-free C.  I did the latter and
considered that I had learned a lesson.

//comments have since been seen in "C with classes" and its current
descendant C++.  It's convenient if you have it but if you're writing
C code that needs to be widely portable you dare not use this feature.



More information about the Comp.lang.c mailing list