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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.ecp.fr!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: Unchecked_Union record inside an other record - trouble Date: Fri, 08 Aug 2014 19:56:15 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:188265 Date: 2014-08-08T19:56:15+03:00 List-Id: Adam Beneschan wrote: > On Friday, August 8, 2014 8:36:48 AM UTC-7, Victor Porton wrote: >> I am trying to interface my program with a C library. > >> The below program does not compile: >> main.adb:19:14: unconstrained subtype in component declaration > >> If this does not work, what should I do to interface a union inside a >> struct in a C library? > >> -- main.adb >> >> with Interfaces.C; use Interfaces.C; > >> procedure Main is > >> type Kind is (First, Second); > >> type T(K: Kind) is > > change this to > > type T(K: Kind := Kind'First) is Done. But it is a hack. I propose to change ARM not to require a discriminant in this specific case (Unchecked_Union). -- Victor Porton - http://portonvictor.org