comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.tsoh+bauhaus@maps.futureapps.de>
Subject: Re: Pure, Storage_Size and Unchecked_Conversion
Date: Sun, 08 Jul 2007 11:49:52 +0200
Date: 2007-07-08T11:49:52+02:00	[thread overview]
Message-ID: <1183888192.6233.6.camel@kartoffel> (raw)
In-Reply-To: <1183854255.792142.110150@i38g2000prf.googlegroups.com>

On Sat, 2007-07-07 at 17:24 -0700, Y.Tomino wrote:

> with Ada.Unchecked_Conversion;
> package Pure_SS_Unc is
>    pragma Pure;
>    type T is access Integer;
>    for T'Storage_Size use 0;
>    function F1 (X : Integer) return T;
>    function F2 is new Ada.Unchecked_Conversion (Integer, T);
> end Pure_SS_Unc;
> 
> [...]
> pure_ss_unc.ads:7:58: named access types not allowed in pure unit

The message should really apply to the declaration of T.
T is a named access type. If you remove all lines referring
to U_C, the compiler might say something like


GNAT 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
Copyright 1992-2005 Free Software Foundation, Inc.

Compiling: pure_ss_unc.ads (source file time stamp: 2007-07-08 09:44:14)

     4.    type T is access Integer;
                |
        >>> named access type not allowed in pure unit

 8 lines: 1 error


Just guessing what your package is supposed to achieve,
have you considered using System.Address_To_Access_Conversions?






  reply	other threads:[~2007-07-08  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  0:24 Pure, Storage_Size and Unchecked_Conversion Y.Tomino
2007-07-08  9:49 ` Georg Bauhaus [this message]
2007-07-08 10:41   ` Y.Tomino
2007-07-08 16:08 ` Martin Krischik
2007-07-09 13:31   ` Y.Tomino
2007-07-09 21:31     ` Georg Bauhaus
2007-07-10  1:35 ` Randy Brukardt
2007-07-10  8:30   ` Georg Bauhaus
2007-07-15 17:30   ` Y.Tomino
replies disabled

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