comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <jrcarter@acm.org>
Subject: Re: Static vs dynamic evaluation anomaly?
Date: Thu, 08 Feb 2007 00:48:25 GMT
Date: 2007-02-08T00:48:25+00:00	[thread overview]
Message-ID: <truyh.261466$aJ.73533@attbi_s21> (raw)
In-Reply-To: <1170874545.463017.180430@j27g2000cwj.googlegroups.com>

Adam Beneschan wrote:
> 
> Seems like a pretty lame excuse, though.  Ada does have a Suppress
> pragma to suppress checks; as I understand the documentation, omitting
> -gnato causes certain checks not to be performed, and using -gnatp
> causes even more checks not to be performed, so the result should be
> more or less equivalent to using Suppress.  So it probably isn't
> accurate to say that GNAT isn't Ada in that case, but that's perhaps a
> matter of semantics.  In any case, though, using Suppress, or not
> using -gnato, or using -gnatp, shouldn't produce *different* results.
> The most I would expect is that the behavior would be different in
> cases where an exception would be raised if the check were performed---
> but I would not expect different behavior in a case where *no*
> exception is raised.  And in this case, no exception is raised---the
> Put is outputting different values.  So I still think this is a bug
> that needs to be fixed.  The current behavior (assuming that 4.1.1-22
> behaves the same as 4.0.0) isn't reasonable.

What's happening (I think) is the base type is 8 bits. Without -gnato, 
there's no check to see if the result exceeds this and should be reduced 
mod the modulus, so an out-of-range value is produced. The output is 
always outputting an 8-bit value; with the check, this value always fits 
in 6 bits; without it, it may be larger.

This may well be an error, possibly with Modular_IO.

-- 
Jeff Carter
"It's all right, Taggart. Just a man and a horse being hung out there."
Blazing Saddles
34



  parent reply	other threads:[~2007-02-08  0:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <12shen4qjhv41a7@corp.supernews.com>
2007-02-06 19:17 ` Static vs dynamic evaluation anomaly? Jeffrey R. Carter
2007-02-06 20:01 ` Adam Beneschan
2007-02-06 20:15   ` Ludovic Brenta
2007-02-06 23:38     ` Matt.Jaffe
     [not found]     ` <12sipb529oilnab@corp.supernews.com>
2007-02-07 10:05       ` Ludovic Brenta
2007-02-07 21:54       ` Simon Wright
2007-02-09 12:39         ` GNAT's version Peter Hermann
2007-02-07  3:32   ` Static vs dynamic evaluation anomaly? Steve
2007-02-07 10:00     ` Ludovic Brenta
2007-02-07 10:21       ` Georg Bauhaus
2007-02-07 16:44         ` Adam Beneschan
2007-02-07 18:27           ` Jeffrey R. Carter
2007-02-07 18:55             ` Adam Beneschan
2007-02-07 21:52               ` Simon Wright
2007-02-08  0:48               ` Jeffrey R. Carter [this message]
2007-02-08  1:26                 ` Adam Beneschan
2007-02-08 18:44                   ` Jeffrey R. Carter
2007-02-09  7:57                     ` Stefan Lucks
2007-02-09 18:50                       ` Jeffrey R. Carter
2007-02-09 21:12                         ` Stefan Lucks
2007-02-10  5:22                           ` Jeffrey R. Carter
2007-02-10 12:29                             ` Ludovic Brenta
2007-02-08  6:57             ` Matt Jaffe
2007-02-08  9:01               ` Ludovic Brenta
2007-02-08 10:32                 ` Georg Bauhaus
2007-02-08 11:13                 ` Jean-Pierre Rosen
2007-02-08 13:02                   ` Ludovic Brenta
2007-02-07 21:46         ` Matt.Jaffe
2007-02-07  6:24   ` AW: " Grein, Christoph (Fa. ESG)
2007-02-07  6:59     ` Stefan Lucks
replies disabled

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