🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #8395

Re: 'C' style etc...

#8395
From: David Collier-Brown
Date: Mon, 11 Apr 1988 18:50
27 lines
1831 bytes
| In article <8449@agate.BERKELEY.EDU>, doug@eris.UUCP writes:
||			case 'REXX':
|  This is bad style...it is not guaranteed to work, according to K&R, and
|  certainly does *not* work with many C compilers.

In article <1813@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
| Whadda you know. Every compiler I've hit with this so far has worked just
| fine. I just assumed that it was in K&R. After all, it makes perfect sense,
| modulo byte ordering problems, so by the principle of least astonishment
| it should be there.

  Well, it works IFF you have 4-byte words, or a good promotion
mechanism to make 'REXX' turn into a long automagically (some do).
  It truncates on many 16-bit machines... including one old
pdp-11 I remember fondly.

  If you want something humorous, try using case `REXX` (notice the
quotes) on a machine using an old copy of PCC: It tries to generate
BCD for a GCOS 3 machine.

--dave (prior art, yes. yucko, though) c-b
-- 
 David Collier-Brown.                 {mnetor yunexus utgpu}!geac!daveb
 Geac Computers International Inc.,   |  Computer Science loses its
 350 Steelcase Road,Markham, Ontario, |  memory (if not its mind) 
 CANADA, L3R 1B3 (416) 475-0525 x3279 |  every 6 months.
Technical Details
Message-ID: <2563@geac.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!yunexus!geac!daveb
References: <8647@eddie.MIT.EDU> <893@nuchat.UUCP> <8449@agate.BERKELEY.EDU> <1813@sugar.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!geac!daveb
From: daveb@geac.UUCP (David Collier-Brown)
Newsgroups: comp.sys.amiga.tech,comp.sys.amiga,comp.lang.c
Subject: Re: 'C' style etc...
Summary: case 'REXX':
Keywords: K&R, nonstandard constructs, multi-char char constants, hashing
Message-ID: <2563@geac.UUCP>
Date: 11 Apr 88 18:50:25 GMT
Article-I.D.: geac.2563
Posted: Mon Apr 11 14:50:25 1988
References: <8647@eddie.MIT.EDU> <893@nuchat.UUCP> <8449@agate.BERKELEY.EDU> <1813@sugar.UUCP>
Reply-To: daveb@geac.UUCP (David Collier-Brown)
Organization: The Bunn Department.
Lines: 27