comp.lang.ada
 help / color / mirror / Atom feed
* GNAT 4.2.3 Ubuntu reports weird compile error wrt Unchecked_Access
@ 2008-08-15 20:26 Jerry
  2008-08-16 10:26 ` Ludovic Brenta
  2008-08-17  5:59 ` anon
  0 siblings, 2 replies; 10+ messages in thread
From: Jerry @ 2008-08-15 20:26 UTC (permalink / raw)


I have a curious report from two members of the development team for
PLplot, a popular plotting package for which I have written bindings
in Ada. The project is mature enough that the team decided to enable
Ada by default when building, so I am concerned about the following e-
mail.

========== begin e-mail ============

<First comment from team member>

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;

<Response from another team member>

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).

========= end e-mail ==============

I (Jerry) in fact did not see a problem on my OS X 4.3 compiler.

I could supply more details of the code and might even try to write a
small program but testing on someone else's machine would be a bit
tedious. BUT--this error makes no sense to me--I would expect to (and
_do_) see this error if the line in question is

    PL_Pen_Labels(Index) := Temp_C_String'Access;

The whole purpose of using Unchecked_Access is to make this error go
away. It this a known problem on 4.2.3 Unbutu? Is it a compiler error?
Why does it work as expected on my 4.3 OS X, on 4.3.1-2 Debian
testing, but not 4.2.3 Ubuntu?

Jerry



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-08-17 21:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-15 20:26 GNAT 4.2.3 Ubuntu reports weird compile error wrt Unchecked_Access Jerry
2008-08-16 10:26 ` Ludovic Brenta
2008-08-16 10:35   ` Ludovic Brenta
2008-08-17  0:03   ` Jerry
2008-08-17 17:14     ` Simon Wright
2008-08-17 21:05       ` Jerry
2008-08-17  5:59 ` anon
2008-08-17 19:47   ` anon
2008-08-17 21:14     ` Jerry
2008-08-17 20:58   ` Jerry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox