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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HK_RANDOM_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a24:6f82:: with SMTP id x124mr9248956itb.14.1553522959480; Mon, 25 Mar 2019 07:09:19 -0700 (PDT) X-Received: by 2002:aca:f354:: with SMTP id r81mr11834676oih.157.1553522959181; Mon, 25 Mar 2019 07:09:19 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!w126no8367ita.0!news-out.google.com!r82ni40ita.0!nntp.google.com!w126no8365ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Mar 2019 07:09:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2600:1700:13b0:9e10:f123:54d6:ff6e:b46c; posting-account=2uAEJgoAAAB3eDGmRGb1gie2cncsaATT NNTP-Posting-Host: 2600:1700:13b0:9e10:f123:54d6:ff6e:b46c References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2afba838-16fd-4d5b-906a-b9cd1d864ce6@googlegroups.com> Subject: Re: differences between Ada and C in gnat forcing me to use C instead of Ada From: matthewbrentmccarty@gmail.com Injection-Date: Mon, 25 Mar 2019 14:09:19 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:55954 Date: 2019-03-25T07:09:18-07:00 List-Id: Hi all: "gnat-gps" on my machine Windows 10 (debian subsystem for Linux) (see https= ://docs.microsoft.com/en-us/windows/wsl/install-win10 ) gives me "raised ST= ORAGE_ERROR : s-intman.adb:139 explicit raise" yet the same software works = fine on my "real" debian machine. The compiler works but gant-gps doesn't.= =20 For some reason when I call sane_get_devices as in: type Sane_Device_Ptr is access all sane_sane_h.SANE_Device; for Sane_Device_Ptr'Size use Standard'Address_Size; pragma Convention (C, Sane_Device_Ptr); type Device_Array is array (Integer range <>) of aliased Sane_Device_= Ptr; pragma Convention (C, Device_Array); ... devices : aliased Device_Array (1..5); Status :=3D sane_sane_h.sane_get_devices (devices(1)'Address, sane_sa= ne_h.SANE_Bool(SANE_TRUE)); I get back garbage but in C, it works. Oh, now that makes sense about 'Size= returning bits and sizeof in C returning bytes. 256 bits is indeed 32 byte= s. I wonder why I'm getting back garbage. InterfaceS.C.Strings.chars_ptr'Si= ze=3D64 and sizeof(char *)=3D8 are equivalent. Thanks. I guess I got some more digging to do as to my garbage. Regards, Matthew McCarty