Re: Range checking not working as expected?




"Maciej Sobczak" <no.spam@xxxxxxxxxxx> wrote in message
news:dcatvk$iji$1@xxxxxxxxxxxxxxxxxx
> Vinzent 'Gadget' Hoefler wrote:
>
> > Try again after compiling with -gnato to actually enable the overflow
> > checking.
>
> OK, it "works" now. It is still not what I'd expect - "the default in
> Ada is safety", or something like this; I'd expect to actually need to
> go into some troubles to disable such checking.

You *should* be right. However, GNAT does not default to the behavior
required by the Ada standard in various ways. Some differences might be an
improvement (-gnatE), but IMHO there is no real justification for the
overflow check.

In any case, this has nothing to do with Ada, but rather with a particular
widely-used implementation of it. So far as I'm aware, the other major Ada
compilers all default to doing this checking (that is, they follow the
standard closely by default). Remember, GNAT /= Ada; it's just one
implementation of Ada.

Randy.



.



Relevant Pages

  • Re: Clause "with and use"
    ... Then you didn't try compiling that litte code fragment. ... example as posted is legal Ada 83 and Ada 95. ... Note that 10.1.6gives the visibility rules within use clauses, ... 10.1.6the visibility rules within pragmas and use clauses in context ...
    (comp.lang.ada)
  • Re: 10 rules for benchmarking (was Re: Teaching new tricks to an old dog (C++ -->Ada))
    ... I used GCC-3.4.1 either for compiling your C program and Jim's one. ... Ada: user 0m11.052s, sys 0m0.005s. ... change and GCC wasn't somehow able to link the program and it showed ...
    (comp.lang.ada)
  • Re: APL in its ghetto (?)
    ... >> US government rules for embedded systems at one time required that source ... >> and compiling it to machine code, they wrote C, compiled it to ADA, ... >> compiled the ADA to machine code, and then gave the government the ADA ...
    (comp.lang.apl)
  • Ada IDE [was: what about having ada compile ada on the fly?]
    ... > implementing an api for compiling ada code. ... > see how that would be very useful for making an IDE that would load ... > modules or scripts on the fly. ...
    (comp.lang.ada)
  • Re: what about having ada compile ada on the fly?
    ... I can set the size of an array of records; ... compiled would be Ada. ... > an api for compiling ada code. ... I have ideas for an IDE for linux ...
    (comp.lang.ada)