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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e01fe1b326df26d4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 29 Jun 2005 06:04:25 -0500 Date: Wed, 29 Jun 2005 07:04:30 -0400 From: Jeff Creem User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Division by zero References: <79ahr0jozmqb$.10jzllrcjpmsv.dlg@40tude.net><_pwre.7121$U4.1023104@news.xtra.co.nz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <3amdnX1xs-ikHV_fRVn-rA@comcast.com> NNTP-Posting-Host: 24.147.74.171 X-Trace: sv3-7dtnbk0U/cgfy3WHt/vkdCR50Gj8Y2uRQq3SkusTvy+n/7jpxbvaS/B/Ulr5jbV1pcLYmDc8CK1of2b!4AG0Eim85YMzASW45II9sFpWVVRFnV4vSfBpKdX4FMIetFPrVzlYIsZjV8nsMQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:11726 Date: 2005-06-29T07:04:30-04:00 List-Id: 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.