comp.lang.ada
 help / color / mirror / Atom feed
* Re: Numerical exceptions not raised properly?
  1999-11-01  0:00 ` tmoran
@ 1999-11-01  0:00   ` Stephen Arnold
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Arnold @ 1999-11-01  0:00 UTC (permalink / raw)


In article <7hkT3.224$cn1.1641@typhoon-sf.snfc21.pbi.net>, tmoran@bix.com wrote:

>From the Gnat User's Guide:
>"-gnato
>   Enable other checks, not normally enabled by default, including
>   numeric overflow checking, ..."
>The Gnat compiler defaults to no checking in your program.  If you want
>Ada 95 behavior, you must use the -gnato compilation option.

Thanks; I guess I should try reading the manual once in a while... 8-)

Steve




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Numerical exceptions not raised properly?
@ 1999-11-01  0:00 Stephen Arnold
  1999-11-01  0:00 ` tmoran
  1999-11-02  0:00 ` Robert Dewar
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Arnold @ 1999-11-01  0:00 UTC (permalink / raw)


Howdy folks:

I'm pretty new to Ada, as well as GNAT, so this could be due to my own 
ignorance (rather than a GNAT problem), but it seems that certain 
exceptions are not being raised properly.

Setup:  Win95b with latest GNAT 3.12p package.

When I compile and run some simple code (I'm doing the Lovelace 
tutorial):

with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;

procedure Compute is

 procedure Double(Item : in out Integer) is
 begin -- procedure Double.
   Item := Item + 2;
 end Double;

 X : Integer := 1;   -- Local variable X of type Integer.

begin -- procedure Compute
 loop
  Put_Line("X = ");
  Put(X);
  New_Line;
  Double(X);
 end loop;
end Compute;

It doesn't seem to raise an exception when X gets too big (ie, you can 
see it wrap negative, then it goes to zero and stays there).  When I try 
dividing by zero, the exception is raised correctly.

Is there something I'm missing, or?

Thanks in advance, Steve Arnold




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Numerical exceptions not raised properly?
  1999-11-01  0:00 Numerical exceptions not raised properly? Stephen Arnold
@ 1999-11-01  0:00 ` tmoran
  1999-11-01  0:00   ` Stephen Arnold
  1999-11-02  0:00 ` Robert Dewar
  1 sibling, 1 reply; 5+ messages in thread
From: tmoran @ 1999-11-01  0:00 UTC (permalink / raw)


>It doesn't seem to raise an exception when X gets too big (ie, you can
>see it wrap negative, then it goes to zero and stays there).  When I try
From the Gnat User's Guide:
"-gnato
   Enable other checks, not normally enabled by default, including
   numeric overflow checking, ..."
The Gnat compiler defaults to no checking in your program.  If you want
Ada 95 behavior, you must use the -gnato compilation option.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Numerical exceptions not raised properly?
  1999-11-01  0:00 Numerical exceptions not raised properly? Stephen Arnold
  1999-11-01  0:00 ` tmoran
@ 1999-11-02  0:00 ` Robert Dewar
  1999-11-04  0:00   ` Stephen Arnold
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Dewar @ 1999-11-02  0:00 UTC (permalink / raw)


In article <7vkgnl$u5@chronicle.concentric.net>,
  arnold@nospam.com (Stephen Arnold) wrote:
> Howdy folks:
>
> I'm pretty new to Ada, as well as GNAT, so this could be due
to my own
> ignorance (rather than a GNAT problem), but it seems that
certain
> exceptions are not being raised properly.


This actually functions as an interesting test as to whether
users have accessed the deeply hidden secret archives before
trying to use GNAT, namely the GNAT documentation included
in every GNAT distribution in plain sight.

There really is a LOT of useful stuff there, please don't try
using GNAT without reading it first! At the very least, read
through the list of compiler options ...

I think people these days get used to using programs like
Power Point without reading any documentation (I sure never
read any PP doc), and think that the same is reasonable or
appropriate for compilers, it is not :-)

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Numerical exceptions not raised properly?
  1999-11-02  0:00 ` Robert Dewar
@ 1999-11-04  0:00   ` Stephen Arnold
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Arnold @ 1999-11-04  0:00 UTC (permalink / raw)


In article <7vmkae$p4s$1@nnrp1.deja.com>, Robert Dewar <dewar@gnat.com> 
wrote:

>In article <7vkgnl$u5@chronicle.concentric.net>,
>  arnold@nospam.com (Stephen Arnold) wrote:
>> Howdy folks:
>>
>> I'm pretty new to Ada, as well as GNAT, so this could be due
>to my own
>> ignorance (rather than a GNAT problem), but it seems that
>certain
>> exceptions are not being raised properly.
>
>
>This actually functions as an interesting test as to whether
>users have accessed the deeply hidden secret archives before
>trying to use GNAT, namely the GNAT documentation included
>in every GNAT distribution in plain sight.

I've already been summarily flogged twice on this one; thanks for the 
third flogging 8-O

It's not just PowerPoint (or M$ software), but all GUI stuff should be 
reasonably intuitive.  However, in this case I shouldn't expect it; this 
is my first experience with anything as cool as Ada (this approach 
seemed to work fine with straight gcc in my C class...)

I will research first before I yell for help next time (I *did* ask my 
local guru first, but he couldn't answer so I turned to the list).

Steve




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-11-04  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-01  0:00 Numerical exceptions not raised properly? Stephen Arnold
1999-11-01  0:00 ` tmoran
1999-11-01  0:00   ` Stephen Arnold
1999-11-02  0:00 ` Robert Dewar
1999-11-04  0:00   ` Stephen Arnold

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