This is the mail archive of the
mailing list for the GCC project.
Re: Hexadecimal floats
Joseph S. Myers wrote:-
> Does C++ include hexadecimal floating point constants? How does it define
> preprocessing numbers?
I'm 90% sure it's the same as C89. In other words, no.
> In the course of updating extend.texi to allow for features now being in
> C99, I noticed that G++ objects to hexadecimal floats with -pedantic,
> but still lexes them as numbers in cases where they can't be lexed
> as numbers in C90 (see gcc.dg/c90-hexfloat-2.c), even with -ansi.
Probably set_lang() in cppinit.c needs to be updated with a judicious
CPP_OPTION (pfile, extended_numbers) = 0;
in the right place. Then the C++ front end would see 2 tokens instead
of one, so there'd be no warning but a syntax error instead. I assume
this is what happens for C89.