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 X-Received: by 10.42.235.132 with SMTP id kg4mr5446365icb.22.1407513715172; Fri, 08 Aug 2014 09:01:55 -0700 (PDT) X-Received: by 10.50.44.18 with SMTP id a18mr117111igm.12.1407513715056; Fri, 08 Aug 2014 09:01:55 -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!h18no10274066igc.0!news-out.google.com!px9ni588igc.0!nntp.google.com!h18no16272335igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 8 Aug 2014 09:01:54 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Unchecked_Union record inside an other record - trouble From: Adam Beneschan Injection-Date: Fri, 08 Aug 2014 16:01:55 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:21560 Date: 2014-08-08T09:01:54-07:00 List-Id: 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 -- Adam