From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Modulus and Remainder operations (Was Re: Help with a bit of C code)
Date: 11 Oct 1994 14:42:15 GMT
Date: 1994-10-11T14:42:15+00:00 [thread overview]
Message-ID: <37e887$oh0@watnews1.watson.ibm.com> (raw)
In-Reply-To: 37cigq$6e0@felix.seas.gwu.edu
In article <37cigq$6e0@felix.seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
|> In article <37bof4$ljl@gnat.cs.nyu.edu>, Robert Dewar <dewar@cs.nyu.edu> wrote:
|>
|> >Indeed one can even argue that it promotes portability for a compiler to
|> >deliberately behave in the worst possible manner when given freedom (I
|> >believe that Tuck mentioned that the Intermetrics compiler has two
|> >options, nice and nasty, for choosing order of elaboration, which seems
|> >a good idea, one which we have had on the GNAT todo list for some
|> >time!)
|>
|> Yes, I agree. Indeed, I would love to see an implementer make a random
|> selection among implementation-dependent possibilities (expression
|> evaluation order, etc.) just to discourage side-effect-y code. 0.5 :-)
Indeed, this is the reasoning behind the following implementation advice
in the Safety and Security Annex: "Whenever possible, the implicit
initial value for a scalar subtype should be an invalid representation."
The idea is to smoke out uses of uninitialized scalar variables by
increasing the likelihood that their use will raise Constraint_Error.
This approach provides no guarantees, of course, but it does tip the odds
a little bit in favor of the tester (who gets paid by the bug :-) ).
--
Norman H. Cohen ncohen@watson.ibm.com
next prev parent reply other threads:[~1994-10-11 14:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-09-27 14:40 Modulus and Remainder operations (Was Re: Help with a bit of C code) David A. Cobb
1994-09-28 13:56 ` Robert Dewar
1994-09-29 9:04 ` Christopher Costello
1994-09-29 14:34 ` Norman H. Cohen
[not found] ` <1994Oct7.225248.6208@nosc.mil>
[not found] ` <1994Oct10.084630.19894@sei.cmu.edu>
[not found] ` <37bof4$ljl@gnat.cs.nyu.edu>
[not found] ` <37cigq$6e0@felix.seas.gwu.edu>
1994-10-11 14:42 ` Norman H. Cohen [this message]
[not found] ` <hbakerCxFK2p.4wp@netcom.com>
[not found] ` <1994Oct11.161048.1058@nosc.mil>
1994-10-11 20:06 ` Norman H. Cohen
1994-10-13 1:51 ` Henry G. Baker
1994-10-13 8:27 ` Magnus Kempe
1994-10-13 12:30 ` Robert Dewar
1994-10-14 15:45 ` Henry G. Baker
1994-10-14 22:11 ` Robert Dewar
1994-10-15 17:35 ` Tucker Taft
1994-10-13 10:38 ` Tucker Taft
1994-10-13 21:34 ` Norman H. Cohen
1994-10-14 15:39 ` Henry G. Baker
1994-10-14 22:56 ` David Weller
1994-10-16 1:25 ` Henry G. Baker
1994-10-13 18:13 ` Charles H. Sampson
1994-10-13 16:56 ` Robert I. Eachus
1994-10-13 20:59 ` Robert Dewar
1994-10-13 23:44 ` Bob Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox