Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!ames!amdcad!sun!pitstop!sundc!seismo!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond From: diamond@csl.sony.JUNET (Norman Diamond) Newsgroups: comp.lang.c Subject: Re: Something new in C syntax Keywords: ifdefs comments Message-ID: <10024@diamond.csl.sony.JUNET> Date: 30 Jan 89 04:53:27 GMT References: <4586@bunker.UUCP> <9522@smoke.BRL.MIL> Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 20 In article <4586@bunker.UUCP> allen@bunker.UUCP (C. Allen Grabert) writes: > >I have since decided that the ifdef's do NOT remove the action of the > >comment delimiters. In article <9522@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > Of course not, since comments are processed before preprocessing > directives. This isn't "new". True, it isn't new; it's only surprising and inconsistent. In other cases, whichever construct occurs first (in a left-to-right scan) takes priority. For example, "#ifdef" is a string but not a preprocessor directive; /* "abc */ is a comment but not a syntax error (of unclosed string), etc. Someone intuitively guessed that /* coming first would comment out the # that comes on the next line. Intuition is dangerous to C programs. -- Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net) The above opinions are my own. | Why are programmers criticized for If they're also your opinions, | re-inventing the wheel, when car you're infringing my copyright. | manufacturers are praised for it?