Using _Decimal64

Jonathan Wakely jwakely.gcc@gmail.com
Wed Sep 6 16:21:00 GMT 2017


On 6 September 2017 at 16:59, A.J. Bonnema wrote:
> On 09/06/2017 03:02 PM, Jonathan Wakely wrote:
>>
>>
>>>> That manual page specifically talks about GNU C, not C++, are you
>>>> using C or C++?
>>>
>>>
>>> I am using C.
>>
>> Then it should work OK, and indeed it does work OK for me using Fedora
>> 26 on x86_64.
>
>
> This completely breaks my wooden shoe! (Dutchism).
>
> Indeed, when I created a small program, it compiles. Doesn't run as I
> expected (printf shows a different value), but it compiles and runs.
>
> So I went back to my project and discovered that -std=c11 is the issue: is
> that even possible? Why would c11 be a problem if the _Decimal64 type is
> part of C99? Or maybe I misunderstand the documents and it might be part of
> the standard in the future?

It's not part of any current or previous C standard, it's a TR, which
is a separate document, see https://www.iso.org/deliverables-all.html

The problem is that -std=c11 disables non-standard extensions. The
default for gcc-7 is -std=gnu11 which includes extensions. See
https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html

> Anyways, thank you for your time. Hopefully there is a way to combine C11
> and _Decimal.

Use the -std=gnuNN options, not -std=cNN options.



More information about the Gcc-help mailing list