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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.34.130 with SMTP id z2mr3947464obi.3.1404831193494; Tue, 08 Jul 2014 07:53:13 -0700 (PDT) X-Received: by 10.182.250.195 with SMTP id ze3mr8496obc.34.1404831193245; Tue, 08 Jul 2014 07:53:13 -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!news.glorb.com!uq10no164177igb.0!news-out.google.com!gf2ni1igb.0!nntp.google.com!hn18no308022igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 8 Jul 2014 07:53:13 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.252.147.203; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 71.252.147.203 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: 'Size hack for enumerated types From: "Dan'l Miller" Injection-Date: Tue, 08 Jul 2014 14:53:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:20801 Date: 2014-07-08T07:53:13-07:00 List-Id: On Tuesday, July 8, 2014 2:04:06 AM UTC-5, Simon Wright wrote: > Victor Porton writes: > > Simon Wright wrote: > > No reason to assume either of: > > 1. Ada enumeration is compatible with C int/enum. In ISO 14882 C++2011 (a.k.a. C++11 for the Y2K-challenged living 2000 years= ago) enums are no longer all of type int (or any other mishmash of interpr= etations and proprietary extensions. In C++2011 the following is now legal= syntax & semantics: enum Flag_Type : unsigned char { Libxml_Error_Save, Libxml_Structured_Error= _Save, URI_Interning, WWW_Skip_Init_Finish}; as depicted at section 3.2 on page 8 of: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf Because of the postfix "integralType identifier : bitsize" syntax after the= identifier being declared in C & C++ for bitfields (and the lack of any de= claration of identifier between enum and { here), there is no way in C++201= 1 to specify the underlying type of an enum to be a bit-field, as seems to = be the desire in the Ada analogue along this thread. > > 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. :-( >=20 > Well, try submitting it to the ARG. I expect you'll get rebuffed in > short order. If the ARG is truly committed to interoperability with C & C++, then the AR= G must seriously pursue accommodating N2347 and any other evolutions of C &= C++ feature-set. If the ARG rebuffs this, then repeatedly rebuff the rebu= ffing until seamless interoperability is achieved between Ada and C and bet= ween Ada & C++. Conversely, ISO 9899 C2011 does not allow this new language feature, as sho= wn in section 6.4.4.3 on page 67 of http://www.open-std.org/jtc1/sc22/wg14/= www/docs/n1570.pdf. So perhaps ARG needs to seriously consider adding Conv= ention =3D> C_Plus_Plus or whatever its syntax would be to handle the incre= asing divergence between C++ and C standards.