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: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: David Brown <david at westcontrol dot com>, Martin Sebor <msebor at gmail dot com>, Kostas Savvidis <ksavvidis at gmail dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 27 Aug 2015 11:42:19 +0200 (CEST)
- 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>
- Reply-to: gcc-help at gcc dot gnu dot org
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.
--
Marc Glisse