comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Interfacing enums with C
Date: Mon, 18 Aug 2014 10:19:40 +0100
Date: 2014-08-18T10:19:40+01:00	[thread overview]
Message-ID: <lyd2byjgsz.fsf@pushface.org> (raw)
In-Reply-To: 0JKdnW2RMsGvrGzO4p2dnAA@giganews.com

Peter Chapin <PChapin@vtc.vsc.edu> 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.

  reply	other threads:[~2014-08-18  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 19:02 Interfacing enums with C Victor Porton
2014-08-17 19:39 ` Simon Wright
2014-08-17 19:46   ` Victor Porton
2014-08-17 19:48     ` Victor Porton
2014-08-17 22:48       ` Peter Chapin
2014-08-18  9:19         ` Simon Wright [this message]
2014-08-18  9:17     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox