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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2e1cd42feeec2424 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed1.ip.tiscali.net!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Interfacing to C References: <1107886078.800063.121210@f14g2000cwb.googlegroups.com> From: Ludovic Brenta Date: Tue, 08 Feb 2005 20:01:36 +0100 Message-ID: <87psza98q7.fsf@insalien.org> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:ezp0PydeWRL+zRYzt2ARlzlkuSs= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 08 Feb 2005 20:04:51 CET NNTP-Posting-Host: 83.134.244.88 X-Trace: 1107889491 dreader2.news.tiscali.nl 44111 83.134.244.88:32771 X-Complaints-To: abuse@tiscali.nl Xref: g2news1.google.com comp.lang.ada:8195 Date: 2005-02-08T20:04:51+01:00 List-Id: You're writing a binding to the "marktime" function. Fine. There are problems with your binding, however. In your package spec, you declare a procedure Marktime, which you import. The import is a "completion" in Ada reference manual terms; this means that the procedure "marktime" is completely known after the pragma Import line. Per ARM 3.1.11(7), "At most one completion is allowed for a given declaration." Thus, the compiler will not look for other completions; the procedure does not need a body (and indeed, providing a body is illegal). Except for the dummy procedure, nothing in your package spec needs a completion (i.e. everything is completely defined by the spec). Therefore, your package spec does not need a package body. Per ARM 7.2(4), "A library package_declaration [...] shall not have a body unless it requires a body; pragma Elaborate_Body can be used to require a library_unit_declaration to have a body, if it would not otherwise require one." Here, I think the underlying problem is that you are trying to provide two completions for procedure Marktime: the pragma Import and the body. You must choose one and remove the other. -- Ludovic Brenta.