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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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!news1.google.com!proxad.net!usenet-fr.net!news.enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Christoph Grein Newsgroups: comp.lang.ada Subject: Re: Division by zero Date: Wed, 29 Jun 2005 11:49:07 +0200 Organization: Cuivre, Argent, Or Message-ID: References: <79ahr0jozmqb$.10jzllrcjpmsv.dlg@40tude.net> <_pwre.7121$U4.1023104@news.xtra.co.nz> Reply-To: Christoph.Grein@eurocopter.com NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: melchior.cuivre.fr.eu.org 1120039635 46818 212.85.156.195 (29 Jun 2005 10:07:15 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 29 Jun 2005 10:07:15 +0000 (UTC) To: CLA Return-Path: X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 X-OriginalArrivalTime: 29 Jun 2005 10:03:18.0251 (UTC) FILETIME=[C5EA83B0:01C57C91] X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:11724 Date: 2005-06-29T11:49:07+02:00 declare C: constant := 0; D: constant := 1; A: constant Integer := D / C; -- static, illegal function "/" (Left, Right: Integer) return Integer is begin return 1; end "/"; E: constant := D / C; -- static, illegal F: constant Integer := D / C; -- legal, not static, uses overridden "/" begin null; end; Lurker wrote: >"Robert A Duff" wrote in message >news:wccy88ugorw.fsf@shell01.TheWorld.com... > > > >>11.6(5) is all about run time effects. If divide by zero were illegal >>(which means at compile time), then 11.6 would not apply. 11.6 is also >>(as you said) all about implementation permissions -- i.e. not >>portable. I would hope a legality rule in this area would be portable. >> >> > >OK, I don't want to get *too* deep into the language wars sort >of thing. My surprise was quite pragmatic - I was called in (as a >consultant) to investigate and fix a problem that led to actual program >crash in production. The reason for that crash, as it happened, was >division by zero in some obscure and rarely used part of the code. >Now, I would understand it if it was a variable which is generally >unsolvable. But a constant? At first I thought it must be a bug in this >particular compiler version. But since then I've had quite a few replies >stating that's how it should be. So I don't know anymore... > > >_______________________________________________ >comp.lang.ada mailing list >comp.lang.ada@ada-france.org >http://www.ada-france.org/mailman/listinfo/comp.lang.ada > > > >