Strange warning during C compilation

Emmanuel STAPF manu at stapf.org
Tue Nov 6 19:55:19 EST 2001


Hi,

I'm getting the following warning: warning: pasting "h" and "(" does not
give a valid preprocessing token

Here is the piece of code that shows the problem:

#define CAT(a,b)a ## b
#define TEST_MACRO(n,c,a)       (CAT(n,_done) ? CAT(n,_result) :
CAT(c,a))

extern void* h();
extern void f(void*);
extern void* h_result;
extern char h_done;

void k (void* titi)
{
        f((TEST_MACRO(h,h,())));
}

If you save this code in a test.c file and use `gcc -Wall -c test.c'
here is what you get:

test.c:11:12: warning: pasting "h" and "(" does not give a valid
preprocessing token

Any idea what is wrong here? My gcc version is 3.01. It was also
happening on my gcc version 2.96 with a slightly different error
message: warning: pasting would not give a valid preprocessing token. I
tried with an even older version (2.7.2.3) and no warnings.

Regards,
Manu


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list