C++ Logo


Advanced search

Subject: Re: [ub] Aliasing char16_t with int_least16_t, etc.
From: Lawrence Crowl (Lawrence_at_[hidden])
Date: 2013-11-03 17:41:18

On 11/1/13, Daniel Krügler <daniel.kruegler_at_[hidden]> wrote:
> 2013/11/1 Lawrence Crowl <Lawrence_at_[hidden]>:
>> Reading the C standard, there does not seem to be any requirement
>> that uint* typedefs have the same size as the corresponding int*
>> typedefs.
> I disagree. According to C99 7.18.1 p1:
> "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."

I missed that. The nice thing about standards clauses is that there
are so many to choose from. :-)

Lawrence Crowl

SG12 list run by sg12-owner@lists.isocpp.org