🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3656

Re: Implementation-defined (was: short division question? ( short...)

#3656
From: Mark Brader
Date: Fri, 04 Aug 1995 20:36
40 lines
2397 bytes
I (Mark Brader, msb@sq.com) wrote:
 
> > There is a little bit of looseness in the standard in that it doesn't
> > say that the implementation-defined conversions must always yield the
> > same result for the same value.  As far as I know, this has not been
> > the subject of an official ruling, but it seems clear to me that the
> > intent is that it should -- the consequences otherwise would be
> > ridiculous.

I was talking about conversions involving integral types, but Paul Eggert
(eggert@twinsun.com)'s observation:

> But what about the common practice of giving programmers run-time (or
> compile-time) control over the IEEE floating point rounding mode?
> Doesn't that cause implementation-defined conversions to yield
> different results for the same value?

is still relevant since the essence of the matter may be considered to be
just what "implementation-defined" means.

However, a flag used at compile time may be considered as selecting a
different C implementation (similarly, it is often asserted that the
ANSIness of gcc depends on whether the flags "-ansi -pedantic" are used).
So in that case, the conversion is still constant within a particular
implementation.

And ANSI C provides no run-time call to change the IEEE float rounding
mode; so if a programmer uses such a call, the program is not strictly
conforming and we don't have to think about it further.

So Paul's examples do not show that "implementation-defined" can include
behavior dependent upon a flag.
-- 
Mark Brader   | Nature is often much more interesting than we would like her
msb@sq.com    | to be.  However when we finally do understand something, we
SoftQuad Inc. | strike our foreheads and cry "Of course!", and then marvel at
Toronto       | how beautifully simple it was all the time.   -- Leigh Palmer

This article is in the public domain.
Apologies if you saw it twice -- a local glitch.
Technical Details
Message-ID: <1995Aug4.203650.28487@sq.sq.com>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!torn!sq!msb
References: <3vqpv8$fo0@louie.udel.edu> <1995Aug3.165450.5750@sq.sq.com> <3vsvuj$3gv@light.twinsun.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!torn!sq!msb
From: msb@sq.sq.com (Mark Brader)
Subject: Re: Implementation-defined (was: short division question? ( short...)
Message-ID: <1995Aug4.203650.28487@sq.sq.com>
Supersedes: <1995Aug4.195828.27654@sq.sq.com>
Organization: SoftQuad Inc., Toronto, Canada
References: <3vqpv8$fo0@louie.udel.edu> <1995Aug3.165450.5750@sq.sq.com> <3vsvuj$3gv@light.twinsun.com>
Date: Fri, 4 Aug 95 20:36:50 GMT