Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Thu, 07 Jul 2011 02:26:51 -0400 Organization: The Wasteland Lines: 27 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5957 In article <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com>, Patricia Shanahan wrote: > On 7/6/2011 8:35 AM, rop rop wrote: > > > > If I want to have arithmetic-overflow checking in all parts of an > > application, what is the most practical, simple, efficient way to > > achieve this? > > Write the application in Ada. In one popular implementation, the -gnato compiler option enables numeric overflow checking: The language defined attribute 'Machine_Overflows will indicate if checking is available for fixed or floating point types: JGNAT targets the JVM, but I haven't used it. -- John B. Matthews trashgod at gmail dot com