comp.lang.ada
 help / color / mirror / Atom feed
From: wojtek@power.com.pl (Wojtek Narczynski)
Subject: Repost: Nobody interested to judge which compiler is right?!
Date: 29 Jan 2003 15:00:04 -0800
Date: 2003-01-29T23:00:05+00:00	[thread overview]
Message-ID: <5ad0dd8a.0301291500.24fd2661@posting.google.com> (raw)

Hello,

Please excuse me the disruption, but I believe this problem is
interesting.

The code below compiles with GNAT, but not with Aonix. Could you
people try with other compilers?

Something tells me that if the code is correct, then an Ada compiler
(practically) must support fat pointers. That's the interesting part.


The RM sections IMHO relevant:

3.10.2 27/1 "if D is untagged, then the type of the view shall be D,
and A's designated subtype shall (...) statically match the nominal
subtype of the view or (...)"

4.9.1 2 " A subtype statically matches another subtype of the same
type if they have statically matching constraints."


Regards,
Wojtek Narczynski


with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Text_IO; use Ada.Text_IO;

procedure Tiny is
-- Is this code valid ?!

	type String_Access is access all String;

	subtype Len_Positive is Positive range 1 .. 20;
	subtype Len_String is String ( Len_Positive );
	subtype Len_String_Access is String_Access( Len_Positive );

	LS : aliased Len_String := Len_String'Length * "*";


	-- \/ This compiles with GNAT, but not with Aonix
	LSA : Len_String_Access := LS'access;


begin

	-- \/ This compiles with GNAT, but not with Aonix
	Put_Line( LSA.all );

end Tiny;



             reply	other threads:[~2003-01-29 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-29 23:00 Wojtek Narczynski [this message]
2003-01-30  0:13 ` Repost: Nobody interested to judge which compiler is right?! tmoran
  -- strict thread matches above, loose matches on Subject: below --
2003-01-30  6:53 Grein, Christoph
2003-01-30 18:52 ` Wojtek Narczynski
2003-01-30 20:19   ` Robert A Duff
2003-01-31  6:25 Grein, Christoph
replies disabled

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