comp.lang.ada
 help / color / mirror / Atom feed
* Newbie question about pointers in GNAT 3.15p on Windows 2000
@ 2003-02-21 21:20 David Gressett
  2003-02-21 23:03 ` David C. Hoos, Sr.
  2003-02-22 15:31 ` Steve
  0 siblings, 2 replies; 7+ messages in thread
From: David Gressett @ 2003-02-21 21:20 UTC (permalink / raw)



I have the following package which I am trying to compile with GNAT
3.15p on Windows 2000:

-----------------------------------------------------------------------
package Miscellaneous3 is

  
  function X
    return String;
    
end Miscellaneous3;


package body Miscellaneous3 is

  -----------------------
  -- X --
  -----------------------
  
  type P_Integer is access all Integer;

  function X
    return String
  is
    Bufsize: Aliased Integer;
    P_Size: P_Integer;
    
  begin
    Bufsize := 1;
    P_Size := BufSize'Access;
    return "";
  end X;

end Miscellaneous3;

---------------------------------------------------------------------
Compilation produces this error message:

miscellaneous3.adb:17:15 non-local pointer cannot point to local
object

I have no idea what "local" means here -  both the pointer P_Size and
the pointed-to variable Bufsize are defined in the same place.

What am I doing wrong?






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

end of thread, other threads:[~2003-02-25  2:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-21 21:20 Newbie question about pointers in GNAT 3.15p on Windows 2000 David Gressett
2003-02-21 23:03 ` David C. Hoos, Sr.
2003-02-24 19:05   ` David Gressett
2003-02-24 19:25     ` David Gressett
2003-02-22 15:31 ` Steve
2003-02-24  6:40   ` Newbie question about pointers in GNAT 3.15p on Windows 2000 : to Steve prashna
2003-02-25  2:57     ` Steve

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