comp.lang.ada
 help / color / mirror / Atom feed
From: David Gressett <gressett@airmail.net>
Subject: Newbie question about pointers in GNAT 3.15p on Windows 2000
Date: Fri, 21 Feb 2003 15:20:32 -0600
Date: 2003-02-21T15:20:32-06:00	[thread overview]
Message-ID: <816517EFDE1ABFFF.672EFD9C99861B55.1999743ACE4BA64B@lp.airnews.net> (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?






             reply	other threads:[~2003-02-21 21:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-21 21:20 David Gressett [this message]
2003-02-21 23:03 ` Newbie question about pointers in GNAT 3.15p on Windows 2000 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
replies disabled

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