From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Booth To: Frank Klemm Cc: gcc@gcc.gnu.org Subject: Re: Proposal Date: Tue, 18 Sep 2001 11:06:00 -0000 Message-id: <20010918190527.A15299@daikokuya.demon.co.uk> References: <200109151841.UAA04064@fuchs.offl.uni-jena.de> <20010917235928.A11347@daikokuya.demon.co.uk> <20010918021527.A14623@fuchs.offl.uni-jena.de> X-SW-Source: 2001-09/msg00718.html Frank Klemm wrote:- > For instance you have a program which uses _ in numbers. > But not all compilers will will support this in the beginning. Sure. > It should be possible to write a program which removes these _ inside of > numbers to allow to compile such source files with other compilers. If the _'s aren't already in your source code, I don't see much point putting them there with macros. Wasn't the whole idea legibility? > Without this rule it is impossible to write such a program without > preprocessing the source file. And preprocessed files are no source files > anymore. Well, you might be able to filter it through sed or something, with a little difficulty. > 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. I don't know what you mean by a self-defined macro. I don't understand why you're using macros (see comment above). I'm not even sure what the definition of MY_MERGE_5 is, though I might guess. Anyway, if you insist on macros, you could get what you want through an extra indirection, and an extra macro #if COMPILER_UNDERSTANDS_EXTENDED_NUMBERS #define UNDERSCORE _ #else #define UNDERSCORE #endif #define MY_MERGE_5_INDIRECT (a, b, c, d, e) MY_MERGE_5 (a, b, c, d, e) #define MILLION MY_MERGE_5_INDIRECT (1, UNDERSCORE, 000, UNDERSCORE, 000) But I really can't see the point here. Neil.