This is the mail archive of the gcc-bugs@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]

A##B a preprocessing token?


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]


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