comp.lang.ada
 help / color / mirror / Atom feed
From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Re: How to rename a file?
Date: Fri, 28 Sep 2001 07:39:08 +0000 (UTC)
Date: 2001-09-28T07:39:08+00:00	[thread overview]
Message-ID: <slrn9r8a8r.kv.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: mailman.1001648485.22108.comp.lang.ada@ada.eu.org

* David Botton wrote:
>Ada arrays are passed as C arrays do to the import so the use of String is
>valid, we just need to Zero terminate. Ada record types are also passed as
>pointers, which makes life a lot easier.

There is no guarantee AFAIK. Even GCC (not to mention Ada) has different
ways to do this. Therefore I prefer passing Interfaces.C.Strings.char_p over
Interfaces.C.char_array over Standard.String. Especially, if you look how
Standard.String is implemented: As a small struct, passable in registers or
as a pointer to this struct. In the latter case your C-function may assume
the pointer to the memory area containing the string values and the bounds.

       -fpcc-struct-return
              Use the same convention for  returning  struct  and
              union  values  that is used by the usual C compiler
              on your system.  This convention is less  efficient
              for small structures, and on many machines it fails
              to be reentrant; but it has the advantage of allow�
              ing  intercallability between GCC-compiled code and
              PCC-compiled code.

       -freg-struct-return
              Use the convention that struct and union values are
              returned  in registers when possible.  This is more
              efficient     for     small     structures     than
              -fpcc-struct-return.

              If  you  specify  neither  -fpcc-struct-return  nor
              -freg-struct-return, GNU CC defaults  to  whichever
              convention is standard for the target.  If there is
              no  standard  convention,  GNU   CC   defaults   to
              -fpcc-struct-return.






  reply	other threads:[~2001-09-28  7:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-27 19:43 How to rename a file? Pi
2001-09-27 23:09 ` tmoran
2001-09-27 23:36   ` Larry Kilgallen
2001-09-28  2:16 ` DuckE
2001-09-28  2:54   ` Pi
2001-09-28  3:41   ` David Botton
2001-09-28  7:39     ` Lutz Donnerhacke [this message]
2001-09-28 17:34     ` Pascal Obry
2001-09-28 18:39       ` Larry Kilgallen
2001-09-30  1:51       ` David Botton
2001-09-30  8:53         ` Pascal Obry
2001-09-30 10:21           ` Florian Weimer
2001-09-30 14:53             ` Pascal Obry
2001-09-29  5:02     ` DuckE
2001-09-28  3:16 ` David Botton
2001-09-28 16:03   ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox