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: dewar@gnat.com Subject: Re: Adding Things to Package System Date: 1999/02/18 Message-ID: <7ai6f5$7hk$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 445849876 References: <1999Feb18.192159.18832@nosc.mil> X-Http-Proxy: 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Feb 18 23:07:24 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-02-18T00:00:00+00:00 List-Id: In article <1999Feb18.192159.18832@nosc.mil>, claveman@cod.nosc.mil (Charles H. Sampson) wrote: > I've just come across what looks like an interesting > bug in both ... compilers. <> 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. It is particularly a VERY bad idea to add address arithmetic operations to System. It causes the serious kind of problems that Charle's mentions, and I am a little surprised that other Ada 95 compilers would make this mistake. Perhaps their users never use USE statements or even USE TYPE statements :-) 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? Robert Dewar Ada Core Technologies -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own