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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,de68e4ddf10693 X-Google-Attributes: gid103376,public From: jerry@jvdsys.stuyts.nl (Jerry van Dijk) Subject: Re: Multiple pragma Imports Date: 1998/12/27 Message-ID: #1/1 X-Deja-AN: 426047099 References: <762u9n$kfn$1@nnrp1.dejanews.com> Organization: * JerryWare *, Leiden, Holland Newsgroups: comp.lang.ada Date: 1998-12-27T00:00:00+00:00 List-Id: dewar@gnat.com wrote: : function Junk return Integer; : pragma Import (C, Junk, "junk"); : function Junk return My_Integer; : pragma Import (C, Junk, "junk"); The real problem, IMHO, is that you can overload the Ada subprogram, but not the interfacing pragma. : We have fixed GNAT to properly reject the above program, : but we suspect that the above construction is quite : common, and that other compilers besides GNAT have : accepted this in the past. What I (but then, who am I... :-) would like to see in an ideal world is: Short Term: a) GNAT follows the RM; b) GNAT issuing an error if an interfacing pragma matches more than one subprogram signature; c) GNAT having a switch to revert to its old behaviour to enable use of current bindings, to be fased out at some later date; d) Other compilers following GNAT. Long Term: Serious discussion for the ARG on this subject. I do not think the idea of having the pragma apply to the the next uncompleted subprogram is the right one, as this would force the pragma to follow the subprogram declaration immediately. Whereas it is common idiom to put the interfacing pragmas in the private part of a specification. To get the behaviour I would like to see, the interfacing pragmas should somehow be able to discern between the different subprogram signatures. Maybe this calls for some extended interfacing pragma form, to be implemented by general consensus. But, I immediately admit I'm no language expert... Jerry. -- -- Jerry van Dijk | email: jdijk@acm.org -- Leiden, Holland | member Team-Ada -- Ada & Win32: http://stad.dsl.nl/~jvandyk