[Ada] Fix Short_Address declaration on VMS

Arnaud Charlet charlet@adacore.com
Wed Feb 15 10:19:00 GMT 2006


Manually tested on VMS
Tested on i686-linux, committed on trunk

Integer literals cannot appear naked in an address context, otherwise
ambiguities result. As a reult the bounds of Short_Address cannot simply
be given as 2^32 etc., instead a type is introduced from the which
Short_Address can get it's range via 'First and 'Last.

2006-02-13  Douglas Rupp  <rupp@adacore.com>

	* s-auxdec-vms_64.ads (Short_Address): Wrap it in a type.

-------------- next part --------------
Index: s-auxdec-vms_64.ads
===================================================================
--- s-auxdec-vms_64.ads	(revision 110833)
+++ s-auxdec-vms_64.ads	(working copy)
@@ -37,15 +37,21 @@
 --  These definitions can be used directly by withing this package, or merged
 --  with System using pragma Extend_System (Aux_DEC)
 
---  This is the IPF VMS 64 bit version.
+--  This is the VMS 64 bit version.
 
 with Unchecked_Conversion;
 
 package System.Aux_DEC is
    pragma Preelaborate;
 
+   type Short_Integer_Address is
+     range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
+   --  Integer literals cannot appear naked in an address context, as a
+   --  result the bounds of Short_Address cannot be given simply as 2^32 etc.
+
    subtype Short_Address is Address
-     range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
+     range Address (Short_Integer_Address'First) ..
+           Address (Short_Integer_Address'Last);
    for Short_Address'Object_Size use 32;
    --  This subtype allows addresses to be converted from 64 bits to 32 bits
    --  with an appropriate range check. Note that since this is a subtype of


More information about the Gcc-patches mailing list