From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public From: "Marin David Condic, 561.796.8997, M/S 731-96" Subject: Re: Porting Experiences (was Ada and Pascal etc ) Date: 1997/11/06 Message-ID: <97110617504459@psavax.pwfl.com>#1/1 X-Deja-AN: 287553540 Sender: Ada programming language Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU X-VMS-To: SMTP%"INFO-ADA@VM1.NODAK.EDU" X-VMS-Cc: CONDIC Newsgroups: comp.lang.ada Date: 1997-11-06T00:00:00+00:00 List-Id: Lawrence Kirby writes: >The portability implications of this are small or non-existent (there may >be performace implications in rare circumstances, and issues relating to >data sizes and external data formats). As ever the C language is designed >with the assumption that the programmer knows what he is doing. The use >of ranges implies that you know beforehand what those ranges will be. >In C you follow a set of rules: > I think you missed a very important point and one that has trashed many attempted ports in my experience. While the rules you cite do guarantee a minimum accuracy and intelligent use thereof certainly does help things, what do you do about all the representation issues? Technically, that integer you specify as needing a minimum of 16 bits could get represented with 32 bits. Suppose that it is used in an I/O record to a data file? Now you're incompatible with all the data files built by another version which allocated only 16 bits. Or suppose it is passed as a parameter to an OS routine or routine written in another language or a routine written in C but compiled with a different compiler? There are *many* occasions where the internal representation of a data item is *critical* to the success of a system. Hence not having the ability to explicitly state what sort of representation is required can hurt portability. I don't see why C can't be modified in some subsequent standard to let the programmer dictate that a given number be represented a certain way, so I don't think it is the end of the world. But as things stand now, this is a weakness in the language that hurts portability and if something *does* successfully port without changes, it happens more by accident than by design. MDC Marin David Condic, Senior Computer Engineer Voice: 561.796.8997 Pratt & Whitney GESP, M/S 731-96, P.O.B. 109600 Fax: 561.796.4669 West Palm Beach, FL, 33410-9600 Internet: CONDICMA@PWFL.COM =============================================================================== "Some people say a front-engine car handles best. Some people say a rear-engine car handles best. I say a rented car handles best." -- P. J. O'Rourke ===============================================================================