comp.lang.ada
 help / color / mirror / Atom feed
* type is access cf type is access all?
@ 1995-01-20 11:40 fintan
  1995-01-24 14:32 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: fintan @ 1995-01-20 11:40 UTC (permalink / raw)


trying to get my head around this one and failing!
(Maybe I need a new head?) 

What is the difference between:

   type FooPointers is access Foo;

and

   type FooPointers is access all Foo;

The 9X LRM states 

"if no general_access_modifier {all | constant} appears 
... the access type is a pool-specific access-to_variable 
type"

My reading of this implies that omitting all will result
in variables the access type only being able to designate 
dynamically (new) allocated anonymous variables and not 
non-pool (aliased) variables.

A check of this idea on gnat 2.0 suggests that both types
can designate dynamic and aliased variables.

Anyone know the answer? 

replies by post to me and I will summarise.

fintan

-----------------------------------------------------------

Fintan Culwin PhD
Senior Lecturer Software Engineering
School of Computing
South Bank University
Borough Road
London SE1 0AA

Phone (+44) (0)171 815 7434
Fax   (+44) (0)171 815 7499

fintan@vax.sbu.ac.uk







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

* Re: type is access cf type is access all?
  1995-01-20 11:40 type is access cf type is access all? fintan
@ 1995-01-24 14:32 ` Robert Dewar
  1995-01-24 15:55 ` Michael Feldman
  1995-01-24 18:36 ` Tucker Taft
  2 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1995-01-24 14:32 UTC (permalink / raw)


A check of this idea with GNAT ...

We are flattered that when you find a discrepancy between the RM and GNAT
you worry who is right, but I really think you should assume it is the
RM in all cases :-)

In particular, GNAT has only recently implemented the check that disallows
the use of 'Access to produce pool specific access types. Version 2.01
to be released very shortly we hope (next day or two), has this check,
with error messages that point out the need to use ALL.




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

* Re: type is access cf type is access all?
  1995-01-20 11:40 type is access cf type is access all? fintan
  1995-01-24 14:32 ` Robert Dewar
@ 1995-01-24 15:55 ` Michael Feldman
  1995-01-24 18:36 ` Tucker Taft
  2 siblings, 0 replies; 5+ messages in thread
From: Michael Feldman @ 1995-01-24 15:55 UTC (permalink / raw)


In article <1995Jan20.114005.8916@vax.sbu.ac.uk>,
 <fintan@vax.sbu.ac.uk> wrote:
>
>What is the difference between:
>
>   type FooPointers is access Foo;
>
>and
>
>   type FooPointers is access all Foo;

>My reading of this implies that omitting all will result
>in variables the access type only being able to designate 
>dynamically (new) allocated anonymous variables and not 
>non-pool (aliased) variables.

>A check of this idea on gnat 2.0 suggests that both types
>can designate dynamic and aliased variables.

>Anyone know the answer? 

Yeah, I bumped into this one too. It's a GNAT bug, simple as that.
GNAT is missing the check that would normally prohibit the first type
from desugnating aliuased variables.

The NYU folks know about it; no need to report it to them.

Mike Feldman



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

* Re: type is access cf type is access all?
  1995-01-20 11:40 type is access cf type is access all? fintan
  1995-01-24 14:32 ` Robert Dewar
  1995-01-24 15:55 ` Michael Feldman
@ 1995-01-24 18:36 ` Tucker Taft
  1995-01-25 21:27   ` Robert Dewar
  2 siblings, 1 reply; 5+ messages in thread
From: Tucker Taft @ 1995-01-24 18:36 UTC (permalink / raw)


In article <1995Jan20.114005.8916@vax.sbu.ac.uk>,
 <fintan@vax.sbu.ac.uk> wrote:

>trying to get my head around this one and failing!
>(Maybe I need a new head?) 
>
>What is the difference between:
>
>   type FooPointers is access Foo;
>
>and
>
>   type FooPointers is access all Foo;
>
>The 9X LRM states 
>
>"if no general_access_modifier {all | constant} appears 
>... the access type is a pool-specific access-to_variable 
>type"
>
>My reading of this implies that omitting all will result
>in variables the access type only being able to designate 
>dynamically (new) allocated anonymous variables and not 
>non-pool (aliased) variables.

You are exactly right.

>A check of this idea on gnat 2.0 suggests that both types
>can designate dynamic and aliased variables.
>
>Anyone know the answer? 

GNAT is not yet fully conformant with Ada 95.  It should
complain if you try to use 'Access to generate a value
of a "pool-specific" access type.  

Pool-specific access values may only designate 
objects created by allocators.  This allows pool-specific 
access values to have a representation unique to 
their type, such as an index or offset into the access 
type's storage pool, rather than a full machine address.
Access values of a "general" access type will generally
be full machine addresses, since they can designate objects
"anywhere."

>Fintan Culwin PhD
>South Bank University
>London SE1 0AA
>
>fintan@vax.sbu.ac.uk

-Tucker Taft stt@inmet.com
Intermetrics, Inc.



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

* Re: type is access cf type is access all?
  1995-01-24 18:36 ` Tucker Taft
@ 1995-01-25 21:27   ` Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1995-01-25 21:27 UTC (permalink / raw)


For all those suffering sleepless nights over GNAT's failure to detect the
abuse of pool-specific types, here is output from GNAT version 2.01:

     1. procedure r is
     2.   type a is access integer;
     3.   b : aliased integer;
     4.   c : a;
     5. begin
     6.   c := b'access;
                |
        >>> result must be general access type
        >>> add "all" to type "a" declared at line 2

     7. end;

We hope to have version 2.01 (may be labeled 2.02 when it actually gets out)
in the next day or two for SunOS, and next week for OS/2 and other ports.




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

end of thread, other threads:[~1995-01-25 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-01-20 11:40 type is access cf type is access all? fintan
1995-01-24 14:32 ` Robert Dewar
1995-01-24 15:55 ` Michael Feldman
1995-01-24 18:36 ` Tucker Taft
1995-01-25 21:27   ` Robert Dewar

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