7.18.1p1 uxxx_t <=> xxx_t



My question comes out of a discussion in comp.lang.c in
a thread titled "Typedef Bug/Error".

What is the interpretation of 7.18.1p1, particularly with
regards to exact width types?

n1256 has 7.18.1p1 saying:

When typedef names differing only in the absence or presence
of the initial u are defined, they shall denote corresponding
signed and unsigned types as described in 6.2.5; an
implementation providing one of these corresponding types
shall also provide the other.

It is clear that if both uxxx_t and xxx_t are defined [under 7.18],
they must be corresponding types under 6.2.5.

However, I have been advised that it actually says more:
if _either_ uxxx_t or xxx_t is defined, then so must the other,
and they must be corresponding types under 6.2.5.

In other words, they always exist in pairs as well as
being corresponding types under 6.2.5.

Fundamentally, I'm interpreting 7.18.1p1 as conditional...

When uxxx_t *and* xxx_t are defined...

Defect Report 269 (2002) has a parenthetical comment saying
the intent is that the presence of one requires the presence of
the other...

"...can be derived from the requirement to provide both
or neither of these types..."

But the wording of 7.18.1p1 has radically changed since
then.

Must exact-width types exist in signed/unsigned pairs?

Consider a (freestanding) implementation with the attributes...

CHAR_BIT == 32
UINT_MAX == 4294967295
INT_MAX == 2147483647
INT_MIN == -2147483647 /* sm or 1c, not 2c */

The implementation must define uint32_t. If the exact-width
types must exist in pairs, then it must define int32_t, which it
cannot do if it wishes to claim conformance and align with
the natural architecture.

--
Peter
.



Relevant Pages

  • Re: 7.18.1p1 uxxx_t <=> xxx_t
    ... What is the interpretation of 7.18.1p1, ... When typedef names differing only in the absence or presence ... Defect Report 269 has a parenthetical comment saying ...
    (comp.std.c)
  • Re: Shabbos candles (Was Re: Whats wrong with Conservative Judaism)
    ... only slaves and animals are included. ... Seems to me that this quote supports the opposite conclusion - it's saying ... authoritative interpretation. ... Is it the "real" interpretation? ...
    (soc.culture.jewish.moderated)
  • Re: 9 Bills That Would Put Creationism in the Classroom
    ... over centuries the most detailed theory of interpretation possible. ... The Holy Spirit helps someone to understand it. ... So what are you saying all this for? ... different conclusions about what the "original meaning" of a text is, ...
    (talk.origins)
  • Re: Is sentience an emergent brain behavior?
    ... Allan's argument for dualism as you would like it to be. ... best arguments for your opponent's interpretation and not the worst. ... He didn't want to acknowledge what he was really saying either. ... Can it animate matter? ...
    (comp.ai.philosophy)
  • Re: I have been CHALLENGED. . .
    ... The wife and I were married by a woman priest in the Anglican ... but you guys have a more fairinterpretation afaik. ... You didn't excommunicate someone for thinking the earth goes around the ... I started out saying liberal. ...
    (alt.sysadmin.recovery)