comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff Creem <jcreem@yahoo.com>
Subject: Re: Division by zero
Date: Wed, 29 Jun 2005 07:04:30 -0400
Date: 2005-06-29T07:04:30-04:00	[thread overview]
Message-ID: <3amdnX1xs-ikHV_fRVn-rA@comcast.com> (raw)
In-Reply-To: <fRuwe.11250$U4.1434869@news.xtra.co.nz>

Lurker wrote:

> Well, first of all, redefinition of "/" was not permitted (or there would be
> no point)
> 
> But more to the issue, I have said that the problem was the use of default
> division operator on an integer number.
> 
> Yes, I can write any sorts of custom functions called "/" too. So what?
> 
> The question was if or when compiler should catch trivial mistakes
> like that and, at least, warn you "Are you sure?"
> 
> 

If you are talking about a warning you are into the realm of "quality of
implementation". Given your previous examples (ignoring some of the red 
herrings on the thread) it looks to me like it would be reasonable for
a compiler to warn you. Certainly various compilers I have used over the 
years have provided warnings for less useful potentially dangerous 
conditions.

That is not at all the same thing as saying a compiler that does not
warn you is broken....

However, if you are a paying customer for the compiler you are using it
seems worth a phone call to the vendor. In the end (to some extent) it 
does not matter what the LRM says. You are a customer and are unhappy 
and what you are unhappy about is a case that causes a crash in real 
code and which at first glance (and second glance) appears to be 
something the compiler could reaonable detect.

If you really are looking to statically detect cases that are somewhat 
more non-trivial then I'd suggest something like

http://www.polyspace.com/

Note that with a large pre-existing code base it seems possible 
(likely?) that this latter solution could find a lot of false positives 
but it is hard to know until one tries.






  reply	other threads:[~2005-06-29 11:04 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-11 21:03 Division by zero Lurker
2005-06-12  2:00 ` David C. Hoos, Sr.
2005-06-12  3:04   ` Lurker
2005-06-12  8:39     ` Dmitry A. Kazakov
2005-06-12  9:43       ` Lurker
2005-06-12 10:36         ` Marius Amado Alves
2005-06-12 11:53         ` Dmitry A. Kazakov
2005-06-13  8:03         ` Ole-Hjalmar Kristensen
2005-06-12 13:10       ` Robert A Duff
2005-06-12 16:55         ` Jeffrey Carter
2005-06-13  3:22           ` Keith Thompson
2005-06-14  2:14             ` Jeffrey Carter
2005-06-13  8:47           ` Lurker
2005-06-14  2:19             ` Jeffrey Carter
2005-06-14  8:35               ` Keith Thompson
2005-06-13 12:19           ` Robert A Duff
2005-06-14  2:31             ` Jeffrey Carter
2005-06-14  8:21             ` Lurker
2005-06-14 20:22               ` Randy Brukardt
2005-06-28 21:22               ` Robert A Duff
2005-06-29  5:50                 ` Lurker
2005-06-29 13:27                   ` Robert A Duff
2005-06-29 13:54                     ` Dmitry A. Kazakov
2005-06-29 16:03                       ` Robert A Duff
2005-06-30  1:19                     ` Lurker
2005-06-30 11:16                       ` Stuart Palin
2005-06-29 13:50                   ` Dmitry A. Kazakov
2005-06-29 16:07                     ` Robert A Duff
2005-06-30  8:27                       ` Dmitry A. Kazakov
2005-06-29  9:20                 ` Lurker
2005-06-29  9:49                   ` Christoph Grein
2005-06-29 10:40                     ` Lurker
2005-06-29 11:04                       ` Jeff Creem [this message]
2005-06-29 12:28                         ` Martin Dowie
2005-06-29 13:40                   ` Robert A Duff
     [not found]     ` <5sana1pm436l6vboifijqblu0irf84afkr@4ax.com>
2005-06-12 17:38       ` Simon Wright
2005-06-12 12:21 ` Robert A Duff
2005-06-12 22:53 ` Georg Bauhaus
2005-06-13  8:34   ` Lurker
2005-06-13  8:54     ` Marius Amado Alves
2005-06-13 17:59       ` Simon Wright
replies disabled

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