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=0.1 required=5.0 tests=BAYES_05,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 X-Google-Thread: 10261c,90121986704b5776 X-Google-Attributes: gid10261c,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public From: Dr John Stockton Subject: Re: Yet another stupid language war (was: ... the only languages you need!!) Date: 1997/11/01 Message-ID: #1/1 X-Deja-AN: 286470142 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> Distribution: world X-NNTP-Posting-Host: merlyn.demon.co.uk [158.152.233.145] Organization: Home, Surrey, UK Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.pascal.misc Date: 1997-11-01T00:00:00+00:00 List-Id: 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++ - Type T = { integer or shortint or longint } ; U = array [SizeOf(T)..2] of byte { should fail if T >16 bits } ; V = array [2..SizeOf(T)] of byte { should fail if T< 16 bits } ; W = array [SizeOf(T)..2, 2..SizeOf(T)] of byte { should fail if T<>16 bits } ; Or, UU = string [SizeOf(T)-2] ... -- John Stockton, Surrey, UK. jrs@merlyn.demon.co.uk Turnpike v1.12 MIME. Web URL: http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms and links. Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036) Before a reply, quote with ">" / "> ", known to good news readers (SoRFC1036)