This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Proposal
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>, gcc at gcc dot gnu dot org
- Subject: Re: Proposal
- From: Frank Klemm <pfk at fuchs dot offl dot uni-jena dot de>
- Date: Tue, 18 Sep 2001 02:15:27 +0200
- >Received: (from pfk@localhost)by fuchs.offl.uni-jena.de (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id CAA14740;Tue, 18 Sep 2001 02:15:27 +0200
- References: <200109151841.UAA04064@fuchs.offl.uni-jena.de> <20010917235928.A11347@daikokuya.demon.co.uk>
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