comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: gcc-7 breaks unsized C array bindings
Date: Sun, 27 Aug 2017 00:16:55 -0700 (PDT)
Date: 2017-08-27T00:16:55-07:00	[thread overview]
Message-ID: <d3d91481-51e4-4746-be5f-84f882d4b596@googlegroups.com> (raw)
In-Reply-To: <8e16852a-8d56-401f-bebf-916b918fb020@googlegroups.com>

On Friday, August 25, 2017 at 2:03:08 AM UTC-6, ytomino wrote:
> 
> Ada binding:
> 
>  unsized_C_array : array (Interfaces.C.size_t) of Interfaces.C.int
>     with Import, Convention => C, External_Name => "unsized_C_array";

This creates an array of exactly 0..size_t'last elements -- where size_t'last is at least Integer'Pred(2**16) -- this is quite obviously /NOT/ what you want, and the source of your Storage_Error (as each unsized_C_array takes up so much space).

If I did more interfacing with C I could point you in the right direction, but I can't so someone else will have to weigh in on what a good solution would be.

  reply	other threads:[~2017-08-27  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25  8:03 gcc-7 breaks unsized C array bindings ytomino
2017-08-27  7:16 ` Shark8 [this message]
2017-08-27  7:57   ` Jeffrey R. Carter
2017-08-30 21:27 ` 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