This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Proposal


Frank Klemm wrote:-

> Ada 83 and Ada 95 allows '_' in numbers to separate groups of numbers:
> 
>     0xFFFF_FFFF_FFFF_FFFC
>     1_000_000_000_000
>     0x0FFF_FFFF_FFFF_FFFC
>     10_000_000_000_000
>     3.14159_26535_8979
>     12_768_487.0
>     
> The '_' is allowed at every position between digits, but it is recommend to use 
> it in the way above.

This is possibly a good idea.  It's a trivial patch to implement it
(c-lex.c I think, unless Zack finally applies his number patch); a
comment even exists in the code mentioning that it might be a future
extension.

> It is not allowed to compose numbers with '_' inside of macros.
> 
>   #define MILLION	_MERGE5 ( 1, _, 000, _, 000 )
> 
> This allows easily to write a filter to generate C89 or C99 files.

I don't understand quite what you're saying here.  If you're saying
dissallow concatenation with ## then I would strenuously object, since

1) disallowing it seems gratuitous,
2) it's specifically allowed by the standard, and
3) it would be introducing yet more special cases to the preprocessor,
   which already has too many of those for my liking.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]