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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fee8802cc3d8334d X-Google-Attributes: gid103376,public X-Google-Thread: 10a146,fee8802cc3d8334d X-Google-Attributes: gid10a146,public From: Robert Dewar Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/13 Message-ID: <7jv9ua$nlp$1@nnrp1.deja.com>#1/1 X-Deja-AN: 488963805 References: <7jt2c0$vrb@drn.newsguy.com> X-Http-Proxy: 1.0 x39.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Sun Jun 13 03:52:44 1999 GMT Newsgroups: comp.lang.ada,comp.lang.java.programmer X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-06-13T00:00:00+00:00 List-Id: In article , stt@houdini.camb.inmet.com (Tucker Taft) wrote: > Ada is value-preserving, with a run-time check on overflow > (note that GNAT in some configurations suppresses overflow > checks by default, > which is naughty in some people's view ;-). There is no requirement that the "default" (whatever that may mean) mode of an Ada compiler be the mode in which it is standard compliant. The only requirement is that there is a way of running the compiler that is standard compliant (and of course the VSR for the validation says exactly which set of switches were used for validation). While one can argue about the choice of overflow checks off, constraint checks on being the default, we strongly feel that being standard compliant in other respects is quite the wrong default. In particular, the rather dangerous dynamic approach to elaboration checking that is mandated by the standard is of course available in GNAT (using the -gnatE switch), but we consider it considerably inferior to the default static elaboration analysis which is the default mode. In this default mode, the compiler can determine a guaranteed safe order of elaboration for almost all cases, which is much better than having to delay the checks till run time. But in any case, an important rule is *read the documentation* of whatever compiler you are using, and in particular be careful to know what all the options available for compilation are. GNAT has quite a long list of compilation switches, and many of them are quite useful (for example, it is a very good idea to use -gnatwu for nearly all compilations -- and if you don't know what -gnatwu does, go look it up :-) Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.