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,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,235855e3822c83d1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.149.210 with SMTP id u18mr464429bkv.1.1336076204807; Thu, 03 May 2012 13:16:44 -0700 (PDT) Path: h15ni195227bkw.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sbelmont700@gmail.com Newsgroups: comp.lang.ada Subject: Re: Importing C function with variable argument list Date: Thu, 3 May 2012 13:15:09 -0700 (PDT) Organization: http://groups.google.com Message-ID: <696103.1385.1336076109161.JavaMail.geo-discussion-forums@vbez18> References: <610ee323-4c7f-413d-8568-aed4955f5152@z38g2000vbu.googlegroups.com> <1288794.275.1334249936588.JavaMail.geo-discussion-forums@ynlp2> NNTP-Posting-Host: 206.53.78.59 Mime-Version: 1.0 X-Trace: posting.google.com 1336076204 21464 127.0.0.1 (3 May 2012 20:16:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 3 May 2012 20:16:44 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-05-03T13:15:09-07:00 List-Id: On Friday, April 27, 2012 4:24:59 AM UTC-4, Natasha Kerensikova wrote: > Of course, on platforms where calling convention transmits C.short > arguments exactly like C.int (e.g. for improved alignment, or because > the platform has C.short equivalent to C.int (but then you could use > C.char instead of C.short, since C.char is guaranteed to be strictly > smaller than C.int on conforming hosted implementations)). Isn't the general rule of thumb (since nothing in C is ever well-defined) t= hat an int is the size of the default machine word (32-bit on 32-bit, 64 on= 64, etc)? If that's the case, whether it's stack or register, the calling= convention is very likely going to use an int sized argument for anything = smaller than an int anyway (e.g. if it uses the 32-bit stack, it would have= to push a one-byte char as an int-sized value anyway).