Article View: comp.std.c
Article #4604Re: Undefined result vs. int's holding undefined values.
From: James Kanze US/ESC 60/3/141 #407...
Date: Wed, 10 Jan 1996 09:51
Date: Wed, 10 Jan 1996 09:51
30 lines
2335 bytes
2335 bytes
In article <4cuhdu$ff2@info1.sdrc.com> larry.jones@sdrc.com (Larry
Jones) writes:
|> In article <4cpv1n$apm@der.twinsun.com>, eggert@twinsun.com (Paul Eggert) writes:
|> > Since this is comp.std.c, I'll mention that the (x + y < x) != (y < 0) method
|> > and Daniel Wood's example both port to any C implementation
|> > claiming conformance to LIA-1 (ISO/IEC 10967-1:1994(E),
|> > `Information technology -- Language independent arithmetic -- Part 1:
|> > Integer floating point arithmetic' <ftp://crl.dec.com/pub/misc/lia-1-dis.ps.Z>)
|> > if INT_MODULO is true (which is the only plausible value for INT_MODULO
|> > for real-world C compilers).
|> The current thinking about binding LIA-1 to C allows signed and unsiged
|> integers to have different behavior. Whilst unsigned integers *have*
|> to be MODULO for standard conformance, there is no good reason for
|> signed integers to be the same (other than that many existing machine
|> architectures make it very inconvenient to have them be different).
|> Some (many?) people think that raising an exception of some kind for
|> signed integer overflow is very desirable, rather than allowing the
|> answer to quietly wrap around.
Actually, at least some people think that raising an exception would
be desirable for unsigned as well:-). The problem (in C, at least),
in addition to breaking existing code, is that you do need some type
for which the modulo arithmetic is well defined.
--
James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils, études et réalisations en logiciel orienté objet --
-- A la recherche d'une activité dans une region francophone
Technical Details
Message-ID:
<KANZE.96Jan10105153@slsvewt.lts.sel.alcatel.de>Path:
arc1-ca.pugleaf.net!blackbush.xlink.net!slsv6bt!slsv6bt!kanzeReferences:
<4ck70b$rd7@news.informix.com> <4ckms5$rd7@news.informix.com> <4cpv1n$apm@der.twinsun.com> <4cuhdu$ff2@info1.sdrc.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!blackbush.xlink.net!slsv6bt!slsv6bt!kanze From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) Subject: Re: Undefined result vs. int's holding undefined values. In-Reply-To: larry.jones@sdrc.com's message of 9 Jan 1996 19:58:54 GMT Message-ID: <KANZE.96Jan10105153@slsvewt.lts.sel.alcatel.de> Sender: news@lts.sel.alcatel.de Organization: SEL References: <4ck70b$rd7@news.informix.com> <4ckms5$rd7@news.informix.com> <4cpv1n$apm@der.twinsun.com> <4cuhdu$ff2@info1.sdrc.com> Date: 10 Jan 1996 09:51:52 GMT