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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,47ad7b1ec6646e16 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-26 11:18:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp.cs.ubc.ca!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttls1.wa.home.com.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: <3ABA5AC3.4C6C7536@t-online.de> <3ABB11F2.C35C58FD@canal-plus.fr> <3ABE6443.4119AB52@t-online.de> Subject: Re: How pass a "null" as a parameter of anonymous access type X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Mon, 26 Mar 2001 19:17:51 GMT NNTP-Posting-Host: 24.20.66.55 X-Complaints-To: abuse@home.net X-Trace: news1.sttls1.wa.home.com 985634271 24.20.66.55 (Mon, 26 Mar 2001 11:17:51 PST) NNTP-Posting-Date: Mon, 26 Mar 2001 11:17:51 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:6068 Date: 2001-03-26T19:17:51+00:00 List-Id: Freddy wrote in message news:3ABE6443.4119AB52@t-online.de... > Thanks. I've tried it, but at runtime I always get a constraint_error > (GNAT seems to check the passing of "null" values). Yes -- as any correct Ada compiler must do! The value "null" just does not exist for the type of the parameter. Now, you might be able use "pragma Suppress (Access_Check)" to defeat this. But it seems like any Ada binding to C that uses access parameters for things that you are supposed to be able to pass a null value is in error, plain and simple! Why can't you write your own corrected version of the subprogram declaration, write your own "pragma Import (C, ..." for it, and use the corrected version instead of the erroneous one? Then you're not actually "changing" it, just not using it... and instead using something else that is very similar... :-) Mark Lundquist Rational Software