🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1431

Re: warning: '/*' within comment

#1431
From: diamond
Date: Thu, 14 Jun 1990 05:12
32 lines
1993 bytes
The original poster of this topic has already changed the example
twice, but let's wrap up this tangent.

In article <25176@rphroy.UUCP> tkacik@rphroy.uucp (Tom Tkacik) 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. 

Huh?
|||  C's weird#if 1 /* isn't it */
      '                   '
it has opening and closing 's.
The VALUE of a character constant containing more than one character is
implemenation defined, but its syntactic effect is not.  It is a character
constant.  (And it is #if'ed out.)

-- 
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: <1784@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!decuac!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> <1777@tkou02.enet.dec.com> <25176@rphroy.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!decuac!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: <1784@tkou02.enet.dec.com>
Date: 14 Jun 90 05:12:35 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> <25176@rphroy.UUCP>
Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 32