From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:6214:d85:: with SMTP id e5mr21154970qve.74.1642507694861; Tue, 18 Jan 2022 04:08:14 -0800 (PST) X-Received: by 2002:a25:6d06:: with SMTP id i6mr31626239ybc.216.1642507694668; Tue, 18 Jan 2022 04:08:14 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 18 Jan 2022 04:08:14 -0800 (PST) In-Reply-To: <55bae7e8-f5da-4cfc-b0f9-284bc900d89cn@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=80.194.57.154; posting-account=xS3LTwoAAAB3aeXopC8a-M58TGE8K6go NNTP-Posting-Host: 80.194.57.154 References: <09dcb07d-f7b8-432b-8338-840ff90faef1n@googlegroups.com> <55bae7e8-f5da-4cfc-b0f9-284bc900d89cn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Odd Behaviour From: Mark Wilson Injection-Date: Tue, 18 Jan 2022 12:08:14 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:63389 List-Id: On Tuesday, January 18, 2022 at 11:51:36 AM UTC, Mark Wilson wrote: > On Tuesday, January 18, 2022 at 11:48:23 AM UTC, Jeffrey R.Carter wrote: > > On 2022-01-18 12:05, Mark Wilson wrote: > > > > > > then an error is raised: 'warning: Valued_Procedure has no effect for convention Ada [enabled by default]' > > The GNAT RM says of pragma Import_Valued_Procedure > > > > "Note that it is important to use this pragma in conjunction with a separate > > pragma Import that specifies the desired convention, since otherwise the default > > convention is Ada, which is almost certainly not what is required." > > > > What happens if you replace the import aspects with pragma Import? > > -- > > Jeff Carter > > "Monsieur Arthur King, who has the brain of a duck, you know." > > Monty Python & the Holy Grail > > 09 > Tried pragma Import, and even pragma Convention, so, for instance, > procedure SQLAllocHandle > (Result : out SQLRETURN; > HandleType : in SQL_HANDLE_TYPE; > InputHandle : in SQLHANDLE; > OutputHandlePtr : in out SQLHANDLE) > with > Pre => (Handletype = SQL_Handle_Env); > > pragma Import (C, SQLAllocHandle, "SQLAllocHandle"); > pragma Import_Valued_Procedure (SQLAllocHandle); > > Fails with the same warning. Take the 'pre' out and it works fine. Even tried (which to be fair is a bit of a long shot), procedure SQLAllocHandle (Result : out SQLRETURN; HandleType : in SQL_HANDLE_TYPE; InputHandle : in SQLHANDLE; OutputHandlePtr : in out SQLHANDLE); -- with -- Pre => (Handletype = SQL_Handle_Env); pragma Import (C, SQLAllocHandle); pragma Import_Valued_Procedure (SQLAllocHandle, "SQLAllocHandle", (SQLRETURN, SQL_HANDLE_TYPE, SQLHANDLE, SQLHANDLE), (Reference, Value, Value, Reference)); Do you think I should file a bug report?