Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP Newsgroups: comp.lang.c Subject: Re: Distinguished pointers (was Re: Weird syscall returns) Message-ID: <5193@utcsri.UUCP> Date: Wed, 5-Aug-87 14:17:28 EDT Article-I.D.: utcsri.5193 Posted: Wed Aug 5 14:17:28 1987 Date-Received: Fri, 7-Aug-87 05:31:13 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <274@nuchat.UUCP> <452@sugar.UUCP> Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Organization: University of Toronto Lines: 34 Summary: >> Now we find ourselves on OS9, where the compiler says that '\n' and >> '\r' are both 13. (They thoughtfully provide '\l' == 11). Now the >> switch doesn't work, even though all it needs is to be collapsed. [ "the switch" had a "case '\r':" immediately followed by "case '\n':". ] In article <452@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >Suggestion: give up and accept that if your file formats differ you're >going to have to use #ifdefs... DON'T USE IFDEFS! It's very easy to accidently overuse ifdefs, but when possible you should use the other features of the pre-processor because they are often a more direct way of saying what you want. switch(...) { case '\n': #ifndef OS9 case '\r': is WRONG. The test line should be: #if '\n' != '\r' -- // Alan J Rosenthal // \\ // flaps@csri.toronto.edu, {seismo!utai or utzoo}!utcsri!flaps, \// flaps@toronto on csnet, flaps at utorgpu on bitnet. "To be whole is to be part; true voyage is return."