Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.arch Subject: Re: Specifying int size in C Message-ID: <3899@ficc.uu.net> Date: 18 Apr 89 11:10:34 GMT References: <1032@myrias.UUCP> <12289@reed.UUCP> <16568@winchester.mips.COM> <10377@polyslo.CalPoly.EDU> Organization: Xenix Support Lines: 22 In article <10377@polyslo.CalPoly.EDU>, cquenel@polyslo.CalPoly.EDU (36 more school days) writes: > In 9424 peter@ficc.uu.net (Peter da Silva) sez: > > int:32 x, y; > > int:36 z; /* Unisys 1100 compatibility :-> */ > > int a:8, b:9, c:6; > int32_t x,y; > int16_t c; Oh yes, I know, I know. I'm involved in setting up a company-wide standard for 'C' programming, and we're doing something like this. But the semantics are not quite as good as int:n would be. For example, 1+(unsigned int:3)7 should be 0. Defining specific types does not give you this ability. It'd also be a boon for people porting code to weird machines... sometimes you really need an int with a power-of-2 size, and it's a pain to emulate that by hand on a 36-bit machine. -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Business: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. Personal: ...!texbell!sugar!peter, peter@sugar.hackercorp.com.