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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d8ff1403929a72c0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.24.135 with SMTP id u7mr1200948wif.3.1344264665414; Mon, 06 Aug 2012 07:51:05 -0700 (PDT) Path: n2ni72782163win.0!nntp.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!feeder.erje.net!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Interfacing between Ada and C: records and structs Date: Tue, 31 Jul 2012 23:46:34 +0300 Organization: Tidorum Ltd Message-ID: References: <296e271a-967b-4dfb-8dca-f278ecfae03d@googlegroups.com> <5813d3d2-8a9f-4a08-bf09-db3c62847593@googlegroups.com> <38e1e122-b788-4863-88ce-6b1fd5372e43@googlegroups.com> Mime-Version: 1.0 X-Trace: individual.net gghg3aOyn0GXQf8fO+RixwOPIrtz7vR3wJiefXM7UlwvTj0HT0b9A8CdzAg7ffQs3u Cancel-Lock: sha1:dkLDOueH19/+4ZAjE+4+LQm/Alw= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <38e1e122-b788-4863-88ce-6b1fd5372e43@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-07-31T23:46:34+03:00 List-Id: On 12-07-31 22:44 , awdorrin wrote: > This is code from the POSIX Florist API for Ada. There is a comment > in the code that says that the 'Dummy' tagged null record is: "to > force by-reference parameter mode" Perhaps, in some earlier GNAT, a "tagged null record" would have a zero size, but the same is not true in the current GNAT. If the goal is to force passing by reference, another way is to make the Mutex type limited: type Mutex is limited record Mutex : aliased POSIX.C.pthread_mutex_t; end record; Being "limited" should not increase the size of the record. But it forbids some operations on the type, chiefly ":=". -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .