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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.58.1.133 with SMTP id 5mr16049828vem.32.1404812634032; Tue, 08 Jul 2014 02:43:54 -0700 (PDT) X-Received: by 10.140.101.199 with SMTP id u65mr25905qge.10.1404812634013; Tue, 08 Jul 2014 02:43:54 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!w8no6840137qac.0!news-out.google.com!a8ni13244qaq.1!nntp.google.com!m5no22752qaj.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 8 Jul 2014 02:43:53 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.7.55.189; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.7.55.189 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: 'Size hack for enumerated types From: AdaMagica Injection-Date: Tue, 08 Jul 2014 09:43:54 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:20796 Date: 2014-07-08T02:43:53-07:00 List-Id: On Monday, July 7, 2014 10:23:06 PM UTC+2, Victor Porton wrote: > Simon Wright wrote: > > Victor Porton writes: > >> Where in the Reference Manual it is said that Ada enumeration types > >> are "equivalent" to C int (=enum) type? > > Annex B.1 (http://www.ada-auth.org/standards/12rm/html/RM-B-1.html), > > 2 The Convention aspect is used to indicate that an Ada entity should > > use the conventions of another language. > > 21 If the Convention aspect is specified for a type, then the type shall > > either be compatible with or eligible for the specified convention. > No reason to assume either of: > 1. Ada enumeration is compatible with C int/enum. > 2. Ada enumeration is eligible for the specified convention (the convention > C). > This is a work for a future standard. > It seems that the current one does not assert neither 1 neither 2. :-( B.1(21/3) says "shall", so RM 1.1.5(3) applies. The compiler must reject the code if the enumeration is not compatible with C. B.1(2/3) only says "should". So what does this mean? I gather together with (21), we're safe to assume it works.