Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!lll-tis!ptsfa!hoptoad!xanth!kent From: kent@xanth.UUCP (Kent Paul Dolan) Newsgroups: comp.lang.c Subject: Re: Distinguished pointers (was Re: Weird syscall returns) Message-ID: <1837@xanth.UUCP> Date: Wed, 5-Aug-87 08:24:00 EDT Article-I.D.: xanth.1837 Posted: Wed Aug 5 08:24:00 1987 Date-Received: Sat, 8-Aug-87 06:34:23 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <6129@brl-smoke.ARPA> <274@nuchat.UUCP> Reply-To: kent@xanth.UUCP (Kent Paul Dolan) Organization: Old Dominion University, Norfolk Va. Lines: 25 Summary: worse if you were doing _different_ stuff In article <274@nuchat.UUCP> steve@nuchat.UUCP (Steve Nuchia) writes: [...] >For example, lets say we are switching on an input character, we >wrote the code for UNIX, and we are [porting] it to OS9. > > switch ( getchar() ) > { > ...... > case '\n': > case '\r': > common code for the "enter" morpheme > ...... > } > >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. > Steve Nuchia > {{soma,academ}!uhnix1,sun!housun}!nuchat!steve What ends up happening if the cases didn't have common code; that is, you did something different for '\n' than for '\r'? Seems you could have 1) compiler bletches, or 2) subtle error sneaks through. Kent, the man from xanth.