Path: utzoo!attcan!uunet!mcsun!ukc!mucs!m1!bevan From: bevan@cs.man.ac.uk (Stephen J Bevan) Newsgroups: comp.lang.c Subject: Re: Style guides and portability Message-ID: Date: 12 Jan 91 12:09:20 GMT References: <1163@tredysvr.Tredydev.Unisys.COM> <14824@smoke.brl.mil> Sender: news@cs.man.ac.uk Distribution: comp Organization: Department of Computer Science, University of Manchester Lines: 18 In-reply-to: gwyn@smoke.brl.mil's message of 11 Jan 91 23:03:32 GMT > No, any C compiler worth using (and certainly any that conforms to the > standard) will provide at least 16 bits for an int, at least 32 bits > for a long, and at least 8 bits for a char. While there are uses for > user-defined primitive data types (for example, I use "bool" and > (generic object) "pointer" types), I don't think that int16, int32, etc. > are justifiable. What about the cases where it is a requirement that a particular int MUST be able to hold 32 bit numbers. If you transfer this to a 16 bit int system, your software is going to die horribly. The only way I know around this is to define types like int32 and a lot of macros/functions that go along with them. For example, int32plus, int32divide, ... etc. Does anybody have a better solution ? Stephen J. Bevan bevan@cs.man.ac.uk