On Fri, Aug 15, 2008 at 01:10:33PM -0700, Jerry wrote: > > On Aug 15, 2008, at 10:39 AM, Alan W. Irwin wrote: > > > On 2008-08-15 08:18+0100 Andrew Ross wrote: > > > >> > >> Jerry, > >> > >> This latest change to the Ada bindings causes a build error for me > >> with > >> gnat 4.2.3 on Ubuntu. > >> > >> plplot.adb:2751:37: non-local pointer cannot point to local object > >> The offending line is > >> PL_Pen_Labels(Index) := Temp_C_String'Unchecked_Access; > > > > This must depend on the version of gnat since I don't see this > > error for > > gnat 4.3.1-2 from Debian testing (and I presume Jerry didn't see it > > for his gnat-4.3 version as well). > > > > Perhaps we should just state explicitly that we only support gnat-4.3? > > > > Alan > > > Wow--that looks like a compiler error, as I understand it. In Ada, > pointers are officially called access variables and the "regular" > access variables are designed to never allow dumb pointer stuff such > as danglers. However, the language does allow another access type, > Unchecked_Access, so that you can shoot yourself in the foot if you > so desire. (Actually, the unchecked version is sometimes apparently > necessary, as I found in the above case.) If the offending line were > > PL_Pen_Labels(Index) := Temp_C_String'Access; > > then indeed the compiler would, should, and does issue "non-local > pointer cannot point to local object." However, the sole purpose of > using Unchecked_Access is to make this compile error go away (and > assumes that you really know what you're doing with that pointer). > > I think I'll throw this at comp.lang.ada and see if anyone has > anything to say about it. > > I'm not in favor of supporting only GNAT 4.3, since this is a > relatively new version and I know that lots of people don't update > their compilers if they're not broken--some still use gcc 3.14 or > some such version. And if some version of the compiler is broken then > maybe they should update it.
Jerry, Let me know if you want any further information, or if you like me to try a simpler test case to try and pin this down. Andrew ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel