From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frank Klemm To: Neil Booth , gcc@gcc.gnu.org Subject: Re: Proposal Date: Tue, 18 Sep 2001 09:48:00 -0000 Message-id: <20010918021527.A14623@fuchs.offl.uni-jena.de> References: <200109151841.UAA04064@fuchs.offl.uni-jena.de> <20010917235928.A11347@daikokuya.demon.co.uk> X-SW-Source: 2001-09/msg00711.html 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