From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b084786fb95b5938 X-Google-Attributes: gid103376,public From: claveman@cod.nosc.mil (Charles H. Sampson) Subject: Re: Adding Things to Package System Date: 1999/02/20 Message-ID: <1999Feb20.003952.9906@nosc.mil>#1/1 X-Deja-AN: 446343199 Sender: news@nosc.mil References: <1999Feb18.192159.18832@nosc.mil> <7ai6f5$7hk$1@nnrp1.dejanews.com> Organization: Computer Sciences Corporation Newsgroups: comp.lang.ada Date: 1999-02-20T00:00:00+00:00 List-Id: In article <7ai6f5$7hk$1@nnrp1.dejanews.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. > >< 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".