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:5096:: with SMTP id kk22mr22180934qvb.67.1642506695608; Tue, 18 Jan 2022 03:51:35 -0800 (PST) X-Received: by 2002:a25:b9d2:: with SMTP id y18mr33594463ybj.615.1642506695452; Tue, 18 Jan 2022 03:51:35 -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 03:51:35 -0800 (PST) In-Reply-To: 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <55bae7e8-f5da-4cfc-b0f9-284bc900d89cn@googlegroups.com> Subject: Re: Odd Behaviour From: Mark Wilson Injection-Date: Tue, 18 Jan 2022 11:51:35 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:63388 List-Id: 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.