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.66.141.165 with SMTP id rp5mr1000428pab.47.1408315698380; Sun, 17 Aug 2014 15:48:18 -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!r2no1831261igi.0!news-out.google.com!aw9ni2704igc.0!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 17 Aug 2014 17:48:17 -0500 Date: Sun, 17 Aug 2014 18:48:17 -0400 From: Peter Chapin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Interfacing enums with C References: In-Reply-To: Message-ID: <0JKdnW2RMsGvrGzO4p2dnAA@giganews.com> X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-3UOOyuy4w7GIEGKzNFsUYAUIOWuHEIgyCHFGT4xKnLQs4SAQuIk5vs6MS9HhBzjlEQzYksSL43l1r2J!RKH5KGNs25xlxNecXBkmzYHKG3dZh3s2hu67nHV9Abqn830mKAcq0/3FKQKw2ts= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1890 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Xref: news.eternal-september.org comp.lang.ada:21801 Date: 2014-08-17T18:48:17-04:00 List-Id: 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. Peter