From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 24 Jul 93 21:10:03 GMT From: mdisea!uw-coco!nwnexus!emagnuso@uunet.uu.net (Erik Magnuson) Subject: Re: changing the system package in VAX Ada Message-ID: <22s8fb$9vm@nwfocus.wa.com> List-Id: In article <1993Jul22.072929.1@perky.dasd.honeywell.com> tsorense@perky.dasd.ho neywell.com (Todd A Sorensen) writes: >Does anyone know how to get away with changing the system package in VAX >Ada? I want to make system.address an integer to make it compatible with >our cross compiler for the i960 for documentation purposes (I need the >analysis files for SCA). -- Well, its probably too late now, but why perpetuate the distinctly non-portable notion that an address <=> integer anyway? (It's obvious that you're not using a 960MX if this is true for your 960 compiler!) Make an (almost) abstract data type of System.Address. You can then just change the body of the package to use the appropriate System or compiler intrinsics (or fake the operations not provided by default.) With inlining and optimization, there is no performance overhead. Ours looks something like this: with System; package Address_Arithmetic is subtype Address_Type is System.Address; function "+" (Left : in Address_Type; Right : in Integer) return Address_Type; -- etc, etc. end Address_Arithmetic; The only price you pay is an extra "with" here and there. Now I won't claim this is the best wrapper you can design (should address be derived?), but I've found that assuming that addresses are integer types is one of the hardest issues to reconcile when porting code to several different compilers/architectures. >------------------------------------------------------------------------------ >Todd A Sorensen Honeywell Defense Avionics Systems Division >505-828-5611 internet: tsorense@dasd.honeywell.com > internet: tas@dasd.honeywell.com >------------------------------------------------------------------------------ -- Erik