This is the mail archive of the
mailing list for the GCC project.
Zack Weinberg wrote:-
> Let's get back to what you originally proposed. You want to be able
> to write 1000000 as 1_000_000 for legibility. This would be easy to
> implement and I agree that it would be an improvement. What you need
> to do is decide exactly what the extended syntax is supposed to be.
> For instance, are you allowed to write any of the following?
> 16777216_UL 
> 16777216U_L 
> 0._1234 
> 0x_1234 
> 12.34_e+56 
> 12.34e_+56 
> All but the last are legitimate "preprocessing numbers". I can tell
> you right now that I'll be a lot more receptive to an extension that
> doesn't change the definition of a preprocessing number.
I don't think we want to accept anything that changes the pp-number
definition; I consider it set it stone.
I've labelled your examples above.  is not a pp-number, so I'd
rule it out from the start.
For the rest, I see two reasonable things to say:
1) A pp-number with '_' in it is interpreted as if all '_' were stripped
2) We allow _ only in the integer part of decimals / hex / floats, but
anywhere and anyhow in those parts. Not valid in suffixes. Interpreted
as if the '_' were stripped out. This would invalidate ,  and .
Anything more complex is probably not worth it. 1) is appealling
merely because it is simple and unambiguous.