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]

Re: G++ preprocessor problem with unary ##


Dave Martindale wrote:-

> Please read further down the message.  Yes, deleting most of the "unary ##"
> operators doesn't cause the code to break under 2.95, and does get rid of
> the warnings in 2.96.

Ah, my apologies.  I'd assumed your mail ended with the compiler output.
Yes, the use of ## solely to prevent macro expansion is not supported.  This
was a convenient kludge that works well with preprocessors that do text-based
macro expansion (like MS and Borland too I think) and re-lex the result, but
it doesn't work well when there is no re-lexing phase because the implementation
is to operate on tokens (like GCC now).

As to your problem, it seems that the lines

#define _DECLARE_EVENT_SYSTEM(name,ctypes,types) \
  _DECLARE_BASE_RECEIVER ( name, ##ctypes, ##types )

are the only non-conforming ones.  Since this is nothing but a wrapper macro,
maybe a search and replace would do, or maybe

#define _DECLARE_EVENT_SYSTEM _DECLARE_BASE_RECEIVER

would work too.  I've not tried either, though.

Neil.


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