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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd3300f3a56e7f45 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-18 17:12:26 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: different compilers: different standard types????? Date: 18 Mar 2004 20:08:59 -0500 Organization: Cuivre, Argent, Or Message-ID: References: <200403181313.16003.maa@liacc.up.pt> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1079658555 25269 212.85.156.195 (19 Mar 2004 01:09:15 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 19 Mar 2004 01:09:15 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <200403181313.16003.maa@liacc.up.pt> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:6427 Date: 2004-03-18T20:08:59-05:00 Marius Amado Alves writes: > The standard requires that "the range of Integer should be no wider > than that of Long_Integer" 3.5.4 (25). (I'm not sure this is an > intelligent limitation, but never mind.) What would you like it to say instead? > GNAT defines Integer and Long_Integer for 32-bit, and > Long_Long_Integer for 64-bit. > > So if you want to define an integral type with a greater range than > (the associated with) 32 bits, you have to use Long_Long_Integer as > a base. Hmm. Let's declare a type: type My_Long_Int is range -2**50 .. 2**50 -1; You don't _specify_ Long_Long_Integer, but the compiler does use a 64 bit integer as the base type. Just to be picky :). > But then you hinder portability, because Long_Long_Integer is not > standard. The problem is not that Long_Long_Integer is not standard; the problem is that 64 bits is not standard. Neither, for that matter, is 32 bits; the standard only requires 16 bit integers. > So I guess my question is: Why does not GNAT define Integer (and > Long_Integer) for 64-bits? How would that improve portability? As long as other compilers don't support 64 bit integers, using them will be none-portable. Integer is used for the index of String; it probably does not make sense for that to be 64 bits. Why waste space? It might make sense for Long_Integer to be 64 bits. But none of this really matters; you should _never_ use an integer type declared in Standard (except Integer for String indices, or when you really don't care about size). > AFAICS the standard does not impose a upper limit on Integer. True. > And don't tell me the answer is: Because then Short_Integer would > have 32-bits, and that is not what the C world calls short. That is certainly not the answer; C types are in Interfaces.C, not Standard. -- -- Stephe