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: 10261c,90121986704b5776 X-Google-Attributes: gid10261c,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public From: Simon Wright Subject: Re: Yet another stupid language war (was: ... the only languages you need!!) Date: 1997/11/02 Message-ID: #1/1 X-Deja-AN: 286581295 X-NNTP-Posting-Host: pogner.demon.co.uk [158.152.70.98] References: <34557f2b.1934172@news.mindspring.com> <3458D116.2D34@pseserv3.fw.hac.com> <63anc7$75p$1@darla.visi.com> <345947D2.D20EF8E9@horvath.com> <63d34m$ap7$1@darla.visi.com> <01bce627$82afbec0$400d6dce@my-pc.neosoft.com> Organization: At Home Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.pascal.misc Date: 1997-11-02T00:00:00+00:00 List-Id: Dr John Stockton writes: > In article <01bce627$82afbec0$400d6dce@my-pc.neosoft.com> of Fri, 31 Oct > 1997 18:05:12 in comp.lang.pascal.ansi-iso, Pat Rogers > wrote: > > It is a shame that one cannot specify the range of an > >integer type, or the accuracy of a floating point type in C, for the sake > >of portability. It is nice to have the compiler tell you that your > >application requirements cannot be met, rather than not knowing unless a > >(possibly obscure) bug is detected. > > There are tricks in Pascal, which might adapt to Ada or C/C++ - Who needs tricks? pogner[8]$ cat sizes.ads package Sizes is type T is range -32768 .. 32768; for T'Size use 16; end Sizes; pogner[9]$ gcc -c -gnatc sizes.ads sizes.ads:3:18: size for "T" too small, minimum allowed is 17 -- Simon Wright Work Email: simon.j.wright@gecm.com GEC-Marconi Radar & Defence Systems Voice: +44(0)1705-701778 Command & Information Systems Division FAX: +44(0)1705-701800