Re: 128-bit integer - nonsensical documentation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27 August 2015 at 10:42, Marc Glisse wrote:
> On Thu, 27 Aug 2015, Jonathan Wakely wrote:
>
>>> Are you allowed to include typedefs for uint128_t and int128_t in
>>> <stdint.h>, or would that also only be allowed if it is a proper
>>> extended integer?
>>
>>
>> Those names are not in the namespace reserved for the implementation,
>> so doing that would cause this valid code to fail to compile:
>>
>> #include <stdint.h>
>> typedef struct { } uint128_t;
>> int main() { }
>
>
> C11
> 7.31 Future library directions
> 7.31.10 Integer types <stdint.h>
> Typedef names beginning with int or uint and ending with _t may be added to
> the types defined in the <stdint.h> header.
>
> 7.20.1.1 also gives restrictions on the semantics of any type called
> uintN_t.
>
> I would interpret that as making your program non-portable, if not broken.

Agreed.

I thought only POSIX reserved the _t suffixes, I didn't know about 7.31.10



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux