using __float128 and -std=c++11

Marc Glisse marc.glisse@inria.fr
Tue Oct 13 09:31:00 GMT 2015


On Tue, 13 Oct 2015, Peter van Hoof wrote:

> Consider the following program
>
> #include <quadmath.h>
> __float128 a()
> {
> 	return FLT128_MAX;
> }
>
> When I compile this with any of these commands
>
> g++ -c prog.cc
> g++ -std=c++98 -c prog.cc
> g++ -std=c++03 -c prog.cc
>
> it compiles just fine. However, when I use this
>
> g++ -std=c++11 -c prog.cc
>
> I get the error message
>
> In file included from prog.cc:1:0:
> prog.cc: In function ‘__float128 a()’:
> prog.cc:5:9: error: unable to find numeric literal operator ‘operator"" Q’
>  return FLT128_MAX;
>         ^
> I suspect this is a compiler bug, but would like to double-check first before 
> submitting a report. The compiler doesn't complain about the use of 
> __float128, so I guess that type is deemed compliant with the C++11 standard. 
> So I would assume that I should also be allowed to use __float128 literals...

A more recent version of the compiler should give you a hint about using 
gnu++11 instead (or some other flag I have forgotten).

-- 
Marc Glisse



More information about the Gcc-help mailing list