From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ffc31,8d2315bbfec7d11 X-Google-Attributes: gidffc31,public X-Google-Thread: fdd80,769bc7b1925998af X-Google-Attributes: gidfdd80,public X-Google-Thread: 10cebf,55be15e14d3dee4e X-Google-Attributes: gid10cebf,public X-Google-Thread: 1164f8,769bc7b1925998af X-Google-Attributes: gid1164f8,public From: peter@baileynm.com (Peter da Silva) Subject: Re: Y2038 problems (Re: RT-11/TSX-PLUS Year 2000 Compliant Application Programs) Date: 1998/10/15 Message-ID: <7050j4$ict@web.nmti.com>#1/1 X-Deja-AN: 401367452 References: <3613A881.ED0E72FC@idirect.com> <36249640.328249D1@trailing-edge.com> <70327f$3t2@web.nmti.com> Organization: Bailey Network Management Newsgroups: alt.sys.pdp11,comp.sys.dec,comp.sys.dec.micro,vmsnet.pdp-11 In article , Megan wrote: >peter@baileynm.com (Peter da Silva) writes: >>I've had arguments with people working on DOS and Xenix code, pointing out >>16-bit dependencies, and then people writing Sun or 386 code, where they >>had 32-bit dependencies. The integer-size problem shows the same mindset, >>and it's much much more pervasive than the time_t problem or even the Y2K >>problem... it just doesn't hit everyone at once. >I've always had problems with the size dependencies inherent in C. I haven't found a better language for *avoiding* size dependencies, IF YOU WRITE YOUR CODE AWARE THAT NOT ALL COMPUTERS HAVE THE SAME WORD SIZE. In fact the more the language specifies the size of an object, the more trouble I've had porting code. PL/I, where you specify it down to the bit level, is among the worst. PL/M and Fortran-IV, where you only specify the size in terms of words or bytes, are better. In C you can completely isolate the word size dependencies to a header file where you define your size-specific types (int32, unsigned16, etc) and let the compiler pick an appropriate word size for the rest. Because 99% of the time, the size you want depends on so many other things that are more closely related to the computing environment than the code you're working on. Having the default sizes driven by the hardware's programming model means you don't end up with code that requires multiple word arithmetic for all your integer calculations (because that's what you need to run Unisys 1100 code with 36-bit integers on a 32-bit machine) or having your array indexes have to be rewritten (because all of a sudden DCL OFFSET BIN(17) isn't enough)... Good programming in languages that allow you to specify things that tightly means you end up recreating the equivalent of the C type structure for all your generic values anyway... having to know the sizes of things that closely is the special case. -- In hoc signo hack, Peter da Silva `-_-' "Heb jij vandaag je wolf al geaaid?" 'U` "Tell init(8) to lock-n-load, we're goin' zombie slaying!"