comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: Interfacing to C
Date: Tue, 08 Feb 2005 19:43:42 +0100
Date: 2005-02-08T19:43:45+01:00	[thread overview]
Message-ID: <42090861$0$18555$9b4e6d93@newsread4.arcor-online.net> (raw)
In-Reply-To: <1107886078.800063.121210@f14g2000cwb.googlegroups.com>

Garry wrote:
 
> -- Start of hsdbg.ads
> --
> with Interfaces.C;
> with Interfaces.C.Strings;
> 
> package HSDBG is
> --  Dummy procedure?
>       type DUMB is digits 5 range 0.0 .. 1.0E10;
>       procedure DUMMY (B : DUMB);
> --  End Dummy procedure
>       procedure marktime(Variable : Interfaces.C.Strings.chars_ptr);
>       pragma Import(C, marktime, "marktime");
> end HSDBG;
> -- End of hsdbg.ads
> 

You don't need a dummy procedure, and according to the spec you do
not need a body either.
  The reason is that in general a body is there to complete
the declarations in the spec. As the only subprogram in
the spec, "marktime", is imported, there is nothing to complete
in this sense. Now to require a body, the Ada LRM has this to say
(Section 7.2)

pragma Elaborate_Body
     can be used to require a library_unit_declaration to have a body,
     ... if it would not otherwise require one.


-- Georg



  reply	other threads:[~2005-02-08 18:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-08 18:07 Interfacing to C Garry
2005-02-08 18:43 ` Georg Bauhaus [this message]
2005-02-08 19:01 ` Ludovic Brenta
2005-02-08 19:27 ` Martin Krischik
2005-02-08 20:50 ` Björn Lundin
2005-02-09  7:27   ` Anders Wirzenius
2005-02-09 18:53     ` Garry
2005-02-09 21:35       ` Björn Lundin
  -- strict thread matches above, loose matches on Subject: below --
2009-12-24  9:46 RasikaSrinivasan@gmail.com
2009-12-24 10:01 ` Hibou57 (Yannick Duchêne)
2009-12-25  2:07   ` Keith Thompson
2009-12-31 23:18     ` Robert A Duff
2010-01-01 18:02       ` Keith Thompson
2009-12-24 12:34 ` Niklas Holsti
2009-12-24 14:26   ` RasikaSrinivasan@gmail.com
2009-12-28  7:20   ` Hibou57 (Yannick Duchêne)
2009-12-24 12:35 ` Vadim Godunko
replies disabled

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