This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: 128-bit integer - nonsensical documentation?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Cc: David Brown <david at westcontrol dot com>, Martin Sebor <msebor at gmail dot com>, Kostas Savvidis <ksavvidis at gmail dot com>
- Date: Thu, 27 Aug 2015 10:43:45 +0100
- Subject: Re: 128-bit integer - nonsensical documentation?
- Authentication-results: sourceware.org; auth=none
- References: <1B1111BE-E274-4C80-8189-22B78D77647A at gmail dot com> <55DDAD64 dot 3040607 at westcontrol dot com> <55DDE30A dot 1080506 at gmail dot com> <55DEB83C dot 5010106 at westcontrol dot com> <CAH6eHdSjrG4K10dEZabGpw2CR6HsZEkVwvz5-U0zyqXrgVF1iw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1508271137410 dot 2005 at laptop-mg dot saclay dot inria dot fr>
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