Article View: comp.std.c
Article #1427Re: warning: '/*' within comment
From: Tom Tkacik
Date: Mon, 11 Jun 1990 18:36
Date: Mon, 11 Jun 1990 18:36
26 lines
1527 bytes
1527 bytes
In article <1777@tkou02.enet.dec.com>, diamond@tkou02.enet.dec.com
(diamond@tkovoa) writes:
|> 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 */
The problem is the C's. If the preprocessor tokenizes, it will think that
the 's is the start of 's'. It may issue an error about a missing
closing quote. Even though the text is ignored, this must be analyzed.
--
Tom Tkacik GM Research Labs, Warren MI 48090
Work phone: (313)986-1442 uunet!edsews!rphroy!megatron!tkacik
"I'm president of the United States, and I'm not going to eat anymore
broccoli."
--- George Bush
Technical Details
Message-ID:
<25176@rphroy.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!edsews!teemc!rphroy!tkacikReferences:
<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> <1777@tkou02.enet.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!edsews!teemc!rphroy!tkacik From: tkacik@rphroy.uucp (Tom Tkacik) Newsgroups: comp.std.c Subject: Re: warning: '/*' within comment Message-ID: <25176@rphroy.UUCP> Date: 11 Jun 90 18:36:22 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> <1777@tkou02.enet.dec.com> Sender: news@rphroy.UUCP Reply-To: tkacik@rphroy.uucp (Tom Tkacik) Organization: GM Research, Warren, Mi Lines: 26