🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1417

Re: warning: '/*' within comment

#1417
From: diamond
Date: Mon, 11 Jun 1990 00:56
30 lines
1643 bytes
In article <1990Jun8.224827.23783@diku.dk> thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen) writes:

>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:
>#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

What's the problem?
 #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
preprocesses to
 [contents of <stdio.h>]
 int main(int c, char *v[]) { printf("Hello, world!\n"); return 0; }
regardless of whether the preprocessor really tokenizes or not the line
 C's weird#if 1 /* isn't it */

-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
Proposed group comp.networks.load-reduction:  send your "yes" vote to /dev/null.
Technical Details
Message-ID: <1777@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!xanth!mcnc!decvax.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond
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> <1990Jun8.224827.23783@diku.dk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!xanth!mcnc!decvax.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond
From: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Newsgroups: comp.std.c
Subject: Re: warning: '/*' within comment
Message-ID: <1777@tkou02.enet.dec.com>
Date: 11 Jun 90 00:56:41 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> <1990Jun8.224827.23783@diku.dk>
Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 30