🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1413

Re: warning: '/*' within comment

#1413
From: Lars Henrik Mathiesen
Date: Fri, 08 Jun 1990 22:48
30 lines
1677 bytes
karl@haddock.ima.isc.com (Karl Heuer) writes:
<More generally, `#if 0...#endif' should not be considered a `comment', except
<in the sense of `commenting out code'.  The contents are still lexed into C
<tokens ...

diamond@tkou02.enet.dec.com (diamond@tkovoa) writes:
<Should be: The contents MIGHT still be lexed into PREPROCESSOR tokens

<> 	#if 0
<> 	The compiler won't like this
<Should be:  SOME perfectly valid compilers won't like this
<> 	#endif

If you know of an ANSI C compiler (I don't think it's ``perfectly
valid'' otherwise) which does not lex #if'fed-out blocks into
pptokens, please explain how it handles this conformant (I think)
program:
----------- cut -----------
#include <stdio.h>
#if 0
C's weird\
#if 1		/* isn't it */
#else
int main(int c, char *v[]) { printf("Hello, world!\n"); return 0; }
#endif
----------- cut -----------

--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark      [uunet!]mcsun!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.      thorinn@diku.dk
Technical Details
Message-ID: <1990Jun8.224827.23783@diku.dk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!eru!luth!sunic!dkuug!freja.diku.dk!skinfaxe.diku.dk!thorinn
References: <1990Jun1.200433.6919@druid.uucp> <AaOZGd_00as98coVU9@andrew.cmu.edu> <16786@haddock.ima.isc.com> <371@necssd.NEC.COM> <1774@tkou02.enet.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!eru!luth!sunic!dkuug!freja.diku.dk!skinfaxe.diku.dk!thorinn
From: thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen)
Newsgroups: comp.std.c
Subject: Re: warning: '/*' within comment
Message-ID: <1990Jun8.224827.23783@diku.dk>
Date: 8 Jun 90 22:48:27 GMT
References: <1990Jun1.200433.6919@druid.uucp> <AaOZGd_00as98coVU9@andrew.cmu.edu> <16786@haddock.ima.isc.com> <371@necssd.NEC.COM> <1774@tkou02.enet.dec.com>
Sender: news@diku.dk (The Netnews System)
Organization: Department Of Computer Science, University Of Copenhagen
Lines: 30