comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Interfacing enums with C
Date: Sun, 17 Aug 2014 22:46:34 +0300
Date: 2014-08-17T22:46:34+03:00	[thread overview]
Message-ID: <lsr0qm$559$1@speranza.aioe.org> (raw)
In-Reply-To: lylhqmkisq.fsf@pushface.org

Simon Wright wrote:
> Victor Porton <porton@narod.ru> writes:
> 
>> type Option_Type is (A, B);
>> for Option_Type'Size use Interfaces.C.unsigned'Size;
>> for Option_Type use (A=>1, B=>2);
> 
> What's wrong with
> 
>    type Option_Type is (A, B)
>       with Convention => C;
>    for Option_Type use (A => 1, B => 2);

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.

-- 
Victor Porton - http://portonvictor.org


  reply	other threads:[~2014-08-17 19:46 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 [this message]
2014-08-17 19:48     ` Victor Porton
2014-08-17 22:48       ` Peter Chapin
2014-08-18  9:19         ` Simon Wright
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