Xref: utzoo comp.unix.wizards:18301 comp.std.c:1691 Newsgroups: comp.unix.wizards,comp.std.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Need help using /usr/lib/cpp for generic text Message-ID: <1989Sep23.215325.4968@utzoo.uucp> Organization: U of Toronto Zoology References: <838@pacific.mps.ohio-state.edu> <3323@solo10.cs.vu.nl> <2164@munnari.oz.au> <3346@solo12.cs.vu.nl> Date: Sat, 23 Sep 89 21:53:25 GMT In article <3346@solo12.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >\ #endif 0 >\(a) ^ this token is not legal in dpANS C; V.3 tends not to like it > >What!? The rest of the line isn't ignored? And what was the very good reason >the ANSI committee decided so? Because only a few compilers ignored it, and the rest didn't, and there didn't seem to be any good reason to perpetuate this irregular accident of certain implementations. Try `#endif /* 0 */' if you want to put a comment in. >\(b) You should not use this technique to comment out text in a C program; new >\C compilers are allowed to complain about mismatched quotes when they see >\"don't" and other such text, and some _do_. > >I remember the discussion, but I don't recall the very good reason (here we >go again) why those compilers could complain... A good many compilers tokenize text before doing anything else with it, even preprocessing. To avoid rendering all those implementations illegal, it has to be possible to do this. The preprocessor was never specified clearly enough to say that these implementations are wrong. -- "Where is D.D. Harriman now, | Henry Spencer at U of Toronto Zoology when we really *need* him?" | uunet!attcan!utzoo!henry henry@zoo.toronto.edu