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


On Mon, Sep 17, 2001 at 11:59:28PM +0100, Neil Booth wrote:
> 
> > 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.
> 
For instance you have a program which uses _ in numbers. 
But not all compilers will will support this in the beginning.

It should be possible to write a program which removes these _ inside of
numbers to allow to compile such source files with other compilers.

Without this rule it is impossible to write such a program without
preprocessing the source file. And preprocessed files are no source files
anymore.

To prevent this it is forbidden to use this feature in conjunction with
token concatenation. At least as long as this is not an ISO standard.

For instance try to convert 

   #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )

to the old representation. Note that MY_MERGE_5 is a self defined macro.

-- 
Frank Klemm


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