This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
A##B a preprocessing token?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: A##B a preprocessing token?
- From: Jiri Kolafa <jiri at icpf dot cas dot cz>
- Date: Tue, 6 Nov 2001 16:26:07 +0100 (MET)
Dear gcc maintainers,
In newer gcc/cpp versions, the following feature is deprecated:
* Attempting to paste two tokens which together do not form a valid
preprocessing token
Why? Is there any standard that requires this?
I have used for years a construct that translates
loop (i,from,to)
into
for (i=from; i<to; i++)
and at the same time
loop (i,from,=to)
into
for (i=from; i<=to; i++)
The preprocessor already changed in version 2.3.3 so that the simple (and
still OK with most preprocessors) macro:
#define loop(I,From,To) for (I=From; I<To; I++)
had to be changed into a more complicated version with ##.
However, it is not possible to write such a macro if the result of A##B is
required to be a token.
I would be happy if:
[] A##B was not required to be a token
[] there was an option that would control warning ``pasting "<" and
"i" does not give a valid preprocessing token''
(I get *hundreds* of them!)
Yours Sincerely,
Jiri Kolafa
PS. If you are interested in software I have done with gnu software as
the main tool, please look at http://www.icpf.cas.cz/jiri/macsimus
Jiri Kolafa
E. Hala Laboratory of Thermodynamics
Institute of Chemical Process Fundamentals, Academy of Sciences
Rozvojova 135
CZ-16502 Praha 6-Suchdol
Czech Republic
mailto:jiri@icpf.cas.cz
http://www.icpf.cas.cz/jiri/
FAX: +420 2 20920661
Phone: +420 2 20390301
[By the way, I think the daylight saving time has to be abolished]