Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.lang.c Subject: Re: derived types Message-ID: <6874@watdaisy.UUCP> Date: Tue, 22-Jan-85 16:10:37 EST Article-I.D.: watdaisy.6874 Posted: Tue Jan 22 16:10:37 1985 Date-Received: Wed, 23-Jan-85 05:11:56 EST References: <7579@brl-tgr.ARPA> Organization: U of Waterloo, Ontario Lines: 31 > what we really want is to define c, as knuth did with mix, to say that > char has a minimum holding value of 2^8-1 and short 2^16-1 and long > 2^32-1 with int being bound to either short or long. this eliminates > the implementation problems on all machines because all you do is > select the smallest element that will hold the specified type. > > shades@mit-oz.arpa Except that we'd have to say something like 2^6-1 and 2^12-1. This is a case where even I would not try to make every program as portable as it could be. If there were some reason to assume that chars could hold 2^8-1, I would assume it (and include a warning). But if the standard specifies this, it would leave some machines with an option of (i) non-conforming implementations, (ii) no implementations, or (iii) wasted space and inefficient code just to meet this requirement. And if the standard specifies 2^6-1, then many people (including me) would be discouraged from writing standard-conforming programs. I try to make Pascal programs portable too (standard-conforming and with a certain amount of care, with exceptions carefully encapsulated). But if I need "set of char", I do it and warn that it might not be portable for that reason. -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."