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=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Odd Behaviour Date: Tue, 18 Jan 2022 13:25:27 +0100 Organization: A noiseless patient Spider Message-ID: References: <09dcb07d-f7b8-432b-8338-840ff90faef1n@googlegroups.com> <55bae7e8-f5da-4cfc-b0f9-284bc900d89cn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 18 Jan 2022 12:25:27 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="4de166002d9673ed6313a248996ba33e"; logging-data="7605"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PFdJif8OQmHzkCcoj4L1TJBnWbvBmNyU=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cancel-Lock: sha1:eQivevRqPsCo2xH0I04+a2p88kE= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63391 List-Id: On 2022-01-18 13:08, Mark Wilson wrote: > > 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? Import_Valued_Procedure is GNAT-specific, so it can do whatever they like, but presumably this is unintended behavior and you should report it. You should be able to work around this by making your procedure a wrapper around an imported function with an in out parameter, with SPARK checking turned off in the procedure body. -- Jeff Carter "Monsieur Arthur King, who has the brain of a duck, you know." Monty Python & the Holy Grail 09