Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Sat, 09 Jul 2011 08:53:57 -0400 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 9 Jul 2011 12:54:00 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="BrOwaJANne849xlH+KPYjQ"; logging-data="12412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5Hdy9WgXX129DH/CrDPMj" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 In-Reply-To: Cancel-Lock: sha1:t8k+ixtxgTWYZZ0kXKVQ/aTW/dY= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6016 On 7/9/2011 5:58 AM, rop rop wrote: > On Jul 9, 11:31 am, Tom Anderson wrote: >> You do then have this question of whether code called from a >> @CheckForOverflow also gets checked for overflow (as with strictfp) or >> not. I think not, because existing code will not have been written with >> overflow checking in mind, so it can't be assumed that it will work with >> it on. This is a blow to reuse, but it's not the end of the world. > > I also think not, in the general case... > But you could also have an annotation argument, like > > @CheckForOverflow(allTheWayDown=true) > or > @CheckForOverflow(allTheWayDown=false) I don't think the "true" variant would be workable, since it pretty much forbids hashCode() calls. It probably also forbids loading any classes, so you'd need to ensure that everything "all the way down" was pre-loaded; that's going to be extremely hard with plug-in architectures. But if you're so interested in the topic, why don't you grab the sources and go hack on them for a while? I expect the account of your experiences would be a lot more interesting than idle speculation is. -- Eric Sosman esosman@ieee-dot-org.invalid