Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!ron From: ron@brl-tgr.ARPA (Ron Natalie) Newsgroups: net.lang.c Subject: Re: Re: Standardization questions -- nested comments Message-ID: <5367@brl-tgr.ARPA> Date: Wed, 17-Oct-84 16:03:05 EDT Article-I.D.: brl-tgr.5367 Posted: Wed Oct 17 16:03:05 1984 Date-Received: Thu, 18-Oct-84 19:14:37 EDT References: <12931@sri-arpa.UUCP> <14@tove.UUCP> Organization: Ballistic Research Lab Lines: 44 > The serious problem with no nesting is that whether or not a comment > will work or net depends on the context. Correct, and all you are doing is changing the context rules from one to another by making comments nest. > The #ifdef method is > ugly, and only works for sure if you never use comments or keep them > real short. If there is any chance that a comment may be lurking > around, one cannot just stick a comment string into a C file without > checking an arbitrarily large amount of context information to see > if there is another comment that it will mung. Eh? #ifdef only has the problem that C has in general, unterminated comments. A lint warning about comment ambiguity is required whether you nest or not. If you don't nest (current): /* COMMENT comment_code; /* Comment in comment */ */ The comment is terminated early and the */ is unexpected and generates a comile error or /* Comment missing end. real_code; /* Comment */ No compile error results but read_code gets mysteriously deleted. If you do nest: /* Commented code /* commented comment */ real_code rest of the file gets eaten (but doesn't if you use the current correct syntax)... etc... You probably need to be able to get nit-picking warnings about comments in comments, comments unterminated at end of file, etc... Just anot her gratuitous change to the C language that breaks existing correct code and does not really solve any problems. -Ron "Let's keep C, C." Natalie