Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!watcgl!kdmoen From: kdmoen@watcgl.UUCP Newsgroups: comp.lang.c Subject: Re: Distinguished pointers (was Re: Weird syscall returns) Message-ID: <1547@watcgl.waterloo.edu> Date: Wed, 5-Aug-87 10:55:11 EDT Article-I.D.: watcgl.1547 Posted: Wed Aug 5 10:55:11 1987 Date-Received: Fri, 7-Aug-87 05:42:52 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <6129@brl-smoke.ARPA> <274@nuchat.UUCP> Reply-To: kdmoen@watcgl.waterloo.edu (Doug Moen) Organization: U. of Waterloo, Ontario Lines: 35 In article <274@nuchat.UUCP> steve@nuchat.UUCP (Steve Nuchia) writes: > 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. >To "fix" the problem we have to make the code not reverse portable - >we have to break it to get it to work. I'm not sure I want to require >the compiler to recognise and allow (warning?) the special case of >stacked identical case values, put it might be worth looking into. This isn't pretty, but it solves your problem: switch ( getchar() ) { ...... case '\n': #if '\r' != '\n' case '\r': #endif common code for the "enter" morpheme ...... } -- Doug Moen University of Waterloo Computer Graphics Lab UUCP: {ihnp4,watmath}!watcgl!kdmoen INTERNET: kdmoen@cgl.waterloo.edu