This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc error: warning: pasting "syn" and ")" does not give a valid preprocessing token
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: gcc error: warning: pasting "syn" and ")" does not give a valid preprocessing token
- From: Kiet Tran <ktran at extremenetworks dot com>
- Date: Wed, 04 Jul 2001 15:13:44 -0700
- CC: gcc-bugs at gcc dot gnu dot org
- References: <3B3CF6C9.2B49F019@extremenetworks.com> <oru20y7j5p.fsf@guarana.lsd.ic.unicamp.br>
Hi Alexandre;
Thanks for the suggestion. I was able to get my code to
compile now.
However, I had to do a work around as in the following
statement:
#define TCP_EXTERN(state) \
extern pspec_t * state##_rcv_rst(tcb_t *,pspec_t *), \
* state##_rcv_syn(tcb_t *,pspec_t *), \
* state##_rcv_ack(tcb_t *,pspec_t *), \
* state##_rcv_fin(tcb_t *,pspec_t *), \
* state##_snd_rst(tcb_t *,pspec_t *), \
* state##_snd_syn(tcb_t *,pspec_t *), \
* state##_snd_ack(tcb_t *,pspec_t *), \
* state##_snd_fin(tcb_t *,pspec_t *)
My original define is as in the following:
#define TCP_EXTERN(state) \
extern pspec_t *##state##_rcv_rst(tcb_t *,pspec_t *), \
....
I removed the leading '##' pair and found that the
passing parameter of the macro was not replacing
'state' word. The preprocessor replaced the 'state'
parameter after I insert a space between the '*' character
and 'state##' word. Is this a real bug in the preprocessor?
Regards,
Kiet