comp.lang.ada
 help / color / mirror / Atom feed
From: claveman@cod.nosc.mil (Charles H. Sampson)
Subject: Re: Adding Things to Package System
Date: 1999/02/20
Date: 1999-02-20T00:00:00+00:00	[thread overview]
Message-ID: <1999Feb20.003952.9906@nosc.mil> (raw)
In-Reply-To: 7ai6f5$7hk$1@nnrp1.dejanews.com

In article <7ai6f5$7hk$1@nnrp1.dejanews.com>,  <dewar@gnat.com> wrote:
>In article <1999Feb18.192159.18832@nosc.mil>,
>  claveman@cod.nosc.mil (me) wrote:
>> I've just come across what looks like an interesting
>> bug in both ... compilers.
>
><<description of effect of adding stuff to System making
>  programs illegal>>
>
>ANY addition to System will make some legal programs
>illegal, and it is indeed a very bad idea to add stuff
>to System.
>
>In GNAT, we use EXACTLY the RM definition of System,
>precisely to avoid these nasty kinds of effects.
>
>Now of course we also need compatibility with other Ada
>compilers who have (perhaps injudiciously in the past)
>added junk to System, notably DEC Ada 83, which adds piles
>of stuff.
>
>Our solution to this is the pragma
>
>  pragma Extend_System (package_name);
>
>which takes the given package and merges its declarations
>into an extended version of package System. This of course
>leads to the kind of problems Charles mentions, but you
>only get them if you ask for them.

     What a nice implementation!  Simple and clean.  But why did you do 
it this way rather than following the advice (contained within the im-
plementation permission section of 13.7) of a child package?  Are you
actually trying to capture Dec Ada code?

> ...

>The trouble is that if you add address arithmetic to
>System, and do a USE SYSTEM, which even many USE-allergic
>folks will tolerate, then the "proper" way of doing address
>arithmetic in Ada 95 will not work. This seems a severe
>inconvenience to me. Are you sure you are making a correct
>analysis of other compilers here?

     Package System in both the Green Hills and ObjectAda implementa-
tions contain a declaration similar to

      function "+" (Left : Address, Right : Integer) return Address;

as well as the commutative variation.  Green Hills, which is my vendor, 
didn't tell me why they chose to ignore the advice.  I have no idea why
ObjectAda did either; they're a colleague's vendor and he doesn't have
time to ask them right now.  (He's in typical alligator-fighting mode.)

				Charlie
--
******

     For an email response, my user name is "sampson" and my host
is "spawar.navy.mil".




  reply	other threads:[~1999-02-20  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-18  0:00 Adding Things to Package System Charles H. Sampson
1999-02-18  0:00 ` dewar
1999-02-20  0:00   ` Charles H. Sampson [this message]
1999-02-20  0:00     ` Matthew Heaney
1999-02-21  0:00     ` dewar
1999-02-23  0:00 ` Tucker Taft
1999-02-26  0:00   ` Charles H. Sampson
1999-02-27  0:00     ` Tucker Taft
1999-02-28  0:00       ` dewar
1999-02-28  0:00     ` robert_dewar
replies disabled

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