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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Interfacing enums with C Date: Mon, 18 Aug 2014 10:19:40 +0100 Organization: A noiseless patient Spider Message-ID: References: <0JKdnW2RMsGvrGzO4p2dnAA@giganews.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="b814ca014269fd1fa21bc4c05b94dd9e"; logging-data="7693"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HMc8jH8rZRrow46AHyT+reeBxeujbl2M=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:1EpRQ4Z39XagL7EzqA46R0oFcMc= sha1:uDQ2QgRKMUCTHEP/F6UFojF64Uw= Xref: news.eternal-september.org comp.lang.ada:21804 Date: 2014-08-18T10:19:40+01:00 List-Id: Peter Chapin writes: > On 2014-08-17 15:48, Victor Porton wrote: > >>> http://www.ada-auth.org/standards/12rm/html/RM-B-1.html 14/3 - 18 >>> does not say that enumeration types are eligible for convention C. >>> >>> So, in my opinion, RM does not require the following code to be >>> compilable: >>> >>> type Option_Type is (A, B) >>> with Convention => C; >>> >>>> And your first interfacing convention is much better. IMO. >> >> BTW, I could propose enumeration type to be eligible for Convention C >> in the next version of Ada RM! > > FWIW, GNAT does allow 'Convention => C' for enumeration types. So > Simon's suggestion should work with GNAT if you are willing to make > use of a GNAT extension. Not sure it's precisely an _extension_ so much as a taking-up of an implementation permission.