comp.lang.ada
 help / color / mirror / Atom feed
* GNAT 3.05 distribution, Float Exception Handling Error
@ 1996-09-14  0:00 JRMONROE
  1996-09-15  0:00 ` David C. Hoos, Sr.
  1996-09-15  0:00 ` Robert Dewar
  0 siblings, 2 replies; 5+ messages in thread
From: JRMONROE @ 1996-09-14  0:00 UTC (permalink / raw)



The GNAT 3.05 release of Ada 95, using the Adacomps program,  causes a
floating point exception when dividing a float by 0.0.  The exception
handler does not handle this error.  Any ideas on why or where a fix for
this bug is?  The prgram just aborts with a float exception.




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

* Re: GNAT 3.05 distribution, Float Exception Handling Error
  1996-09-14  0:00 GNAT 3.05 distribution, Float Exception Handling Error JRMONROE
  1996-09-15  0:00 ` David C. Hoos, Sr.
@ 1996-09-15  0:00 ` Robert Dewar
  1996-09-15  0:00   ` JRMONROE
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Dewar @ 1996-09-15  0:00 UTC (permalink / raw)



JRMONROE says

"The GNAT 3.05 release of Ada 95, using the Adacomps program,  causes a
floating point exception when dividing a float by 0.0.  The exception
handler does not handle this error.  Any ideas on why or where a fix for
this bug is?  The prgram just aborts with a float exception."

It is not clear if this is a bug or not without more details. In particular,
you must say which version of GNAT you are using (there are lots of
different ports of 3.05, nine to the PC alone!, you must say what machine
you are using and what operating system).

Also, if you want the GNAT maintainers to look at the problem, it is useless
to post here. You must follow the directions in the documentation and
send a bug report to report@gnat.com.





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

* Re: GNAT 3.05 distribution, Float Exception Handling Error
  1996-09-15  0:00 ` Robert Dewar
@ 1996-09-15  0:00   ` JRMONROE
  1996-09-16  0:00     ` David C. Hoos, Sr.
  0 siblings, 1 reply; 5+ messages in thread
From: JRMONROE @ 1996-09-15  0:00 UTC (permalink / raw)



I use a 486/66, 16megs ram, Dos ver 6.22, wFw3.11, also win95 ,but the
win95 gnat works fine.  The dos gnat305 is not working for this floating
point error.  I tried the following code and it gives me the following
error:

with ada.text_io, ada.float_text_IO;
use ada.text_io, ada.float_text_io;
procedure Testing is
    -- declarations
    a:float:=20.0;
    b:float:=5.0;
    c:float:=0.0;
    
    test:exception;
begin
    -- statements
    begin -- begin block
    put_line("THIS IS A TEST");
    new_line;
    put("20/5= ");
    put(a/b);
    new_line;
    put("20/0=");
    put(a/c);
    exception
    	when constraint_error =>
    		put_line("CONSTRAINT ERROR");
    	when others =>
    		put_line("some other error was made");	
    		
    end; --block
    Put_line("THIS SHOULD BE AFTER EXCEPTION!!");
    
end Testing;

Error is:
Exiting due to signal SIGFPE
Floating Point exception at eip=0000c19d
eax=00000002 ebx=0005efec ecx=00000005 edx=0001ef40 esi=00000054
edi=0001f044
ebp=0005f014 esp=0005efb8 cs=00af ds=00b7 es=00b7 fs=0087 gs=00c7 ss=00b7
Call frame traceback EIPs:
  0x0000c19d
  0x000015da
  0x0000d707

Any help would be appreciated, thank you sincerely,

James R. Monroe
USAF Retired




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

* Re: GNAT 3.05 distribution, Float Exception Handling Error
  1996-09-14  0:00 GNAT 3.05 distribution, Float Exception Handling Error JRMONROE
@ 1996-09-15  0:00 ` David C. Hoos, Sr.
  1996-09-15  0:00 ` Robert Dewar
  1 sibling, 0 replies; 5+ messages in thread
From: David C. Hoos, Sr. @ 1996-09-15  0:00 UTC (permalink / raw)



JRMONROE <jrmonroe@aol.com> wrote in article
<51fjlf$1kk@newsbf02.news.aol.com>...
> The GNAT 3.05 release of Ada 95, using the Adacomps program,  causes a
> floating point exception when dividing a float by 0.0.  The exception
> handler does not handle this error.  Any ideas on why or where a fix for
> this bug is?  The prgram just aborts with a float exception.
> 
Hi,
If you were more precise in your identification of "the Adacomps program"
-- e.g., where the source is available on the Internet, we'd be more likely
able to help.
-- 
David C. Hoos, Sr.,
http://www.dbhwww.com
http://www.ada95.com





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

* Re: GNAT 3.05 distribution, Float Exception Handling Error
  1996-09-15  0:00   ` JRMONROE
@ 1996-09-16  0:00     ` David C. Hoos, Sr.
  0 siblings, 0 replies; 5+ messages in thread
From: David C. Hoos, Sr. @ 1996-09-16  0:00 UTC (permalink / raw)



JRMONROE <jrmonroe@aol.com> wrote in article
<51ic3u$t7r@newsbf02.news.aol.com>...
> I use a 486/66, 16megs ram, Dos ver 6.22, wFw3.11, also win95 ,but the
> win95 gnat works fine.  The dos gnat305 is not working for this floating
> point error.  I tried the following code and it gives me the following
> error:
> 
> with ada.text_io, ada.float_text_IO;
> use ada.text_io, ada.float_text_io;
> procedure Testing is
>     -- declarations
>     a:float:=20.0;
>     b:float:=5.0;
>     c:float:=0.0;
>     
>     test:exception;
> begin
>     -- statements
>     begin -- begin block
>     put_line("THIS IS A TEST");
>     new_line;
>     put("20/5= ");
>     put(a/b);
>     new_line;
>     put("20/0=");
>     put(a/c);
>     exception
>     	when constraint_error =>
>     		put_line("CONSTRAINT ERROR");
>     	when others =>
>     		put_line("some other error was made");	
>     		
>     end; --block
>     Put_line("THIS SHOULD BE AFTER EXCEPTION!!");
>     
> end Testing;
Hi,
I don't have gnat305 for DOS running on my machine, so I can't verify the
behavior.  However, there is a workround, suggested by the following
excerpt from the Ada95 Rationale.

If the problem is real on gnat305 for DOS, you should send e-mail to
gnat.com, as directed in the gnat documentation.
---------------------------- Ada 95 Rationale excerpt begins
--------------------------------
11.1 Numeric Error 

Those familiar with the early use of Ada 83 will recall that there was
considerable confusion between Numeric_Error and Constraint_Error in a
number of corner situations. As a consequence the ARG ruled that
implementations should raise Constraint_Error in all situations for which
Numeric_Error was originally intended. This was a non-binding
interpretation with the intention of making it binding in due course. 

Essentially all implementations of Ada 83 now raise Constraint_Error
although for historic reasons some programs may contain dormant handlers
for Numeric_Error. 

The development of Ada 95 provided an opportunity to remove this historic
wart once and for all. It was thus proposed that Numeric_Error be
completely removed. However, many reviewers pointed out that those programs
which had conformed to the advice of AI-387 by consistently writing 


   when Constraint_Error | Numeric_Error =>



would then become illegal. Accordingly, in Ada 95, Numeric_Error is simply
a renaming of Constraint_Error. Such a change alone would still have made
the above illegal because, in Ada 83, all the exceptions in a handler had
to be distinct; a supplementary change is thus that an exception may appear
more than once in a handler in Ada 95. 

Allowing multiple instances of an exception in a given handler has benefits
in other areas. It now allows sequences such as 


   when Text_IO.Data_Error | Integer_IO.Data_Error =>



where there may be documentation advantages in revealing the potential
causes of the exception. 

Of course if the user had deliberately relied upon a distinction between
Numeric_Error and Constraint_Error then the program will now become
incorrect. It may be simply incompatible but may also be inconsistent if
the handlers are in different frames. For a more detailed discussion see
A-4.5. Despite this possibility it was concluded that the perhaps safer
alternative of completely removing Numeric_Error was not appropriate for
this revision although it should be reconsidered at the next revision. 
---------------------------- Ada 95 Rationale excerpt ends
--------------------------------

Hope this helps
-- 
David C. Hoos, Sr.,
http://www.dbhwww.com
http://www.ada95.com

> 




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

end of thread, other threads:[~1996-09-16  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-14  0:00 GNAT 3.05 distribution, Float Exception Handling Error JRMONROE
1996-09-15  0:00 ` David C. Hoos, Sr.
1996-09-15  0:00 ` Robert Dewar
1996-09-15  0:00   ` JRMONROE
1996-09-16  0:00     ` David C. Hoos, Sr.

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