[Top][All Lists]

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

Re: c99 support

From: Chris Vine
Subject: Re: c99 support
Date: Fri, 29 Jun 2018 16:35:49 +0100

On Fri, 29 Jun 2018 12:34:07 +0200
Hans Åberg <address@hidden> wrote:
> > On 29 Jun 2018, at 12:10, Chris Vine <address@hidden> wrote:
> > 
> >> For C++, these are only optional, cf. [1], as they require no padding. So 
> >> an alternative is to typedef the obligatory int_fast<2^k>_t types, perhaps 
> >> leaving the API unchanged.
> >> 
> >> 1.
> > 
> > The fixed size integer types are optional in C99/11 also, depending on
> > whether the platform provides a fixed size integer of the type in
> > question without padding and (for negative integers) a two's complement
> > representation.  
> Yes, I saw that, too. It is important to ensure two's complement, too, which 
> the other types do not.
> > If, say, uint8_t is available in stdint.h for C, it
> > will be available for C++.  §21.4.1/2 of C++17 makes this even more
> > explicit: "The [cstdint] header defines all types and macros the
> > same as the C standard library header <stdint.h>".
> Which C version? In g++7, __STDC_VERSION__ is not defined, only __STDC__.

In C++17, references to "C" are to ISO/IEC 9899:2011.  References to the
C standard library are to "the library described in Clause 7 of ISO/IEC
9899:2011".  In C++11 and C++14, the references are to ISO/IEC
9899:1999.  By default (if you don't use the -std=c++xx flag) g++-7
compiles according to C++14.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]