Re: warnings appearing during preprocessor string concatenation (##)

Robert Schiele <[email protected]> Thu, 6 Mar 2003 14:10:47 +0100
Newsgroups org.kernel.vger.linux-gcc,org.kernel.vger.linux-c-programming,org.kernel.vger.linux-newbie
Message-ID <[email protected]>
On Wed, Mar 05, 2003 at 03:34:39PM -0500, Jamie Risk wrote:
> I have the following line in my code,
> 
> #define FEATURE(select)     feature_structure. ## select ## .member
>   ...
>    FEATURE(test);
> 
> and when I run it through the compiler (gcc 3.2.2 on Linux x86) I get the
> _warning_
> 
>   file.c:111:32: warning: pasting "." and "test" does not give a valid
> preprocessing token
>   file.c:111:32: warning: pasting "test" and "." does not give a valid
> preprocessing token
> 
> If I look at the preprocessor output, (gcc's -E option) it produces what I'm
> hoping for, although I'd like to avoid the warning.  Suggestions?

Just remove the '##' operator.  The preprocessor is right here, there
is nothing to concatenate to a token in your example.

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:[email protected]
signature.asc (application/pgp-signature, 481 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iQEVAwUBPmdI18QAnns5HcHpAQE6awf+JpGHaD18oeDEdz0fgadM3jES0rJ7R/mp
Q9NywLBh4qPtYCC+8dE2Zibtr5RT5RkwYyVMp7szucDBx6juWmgzgLIfk9F1ac9C
cD12h3tk5NAUN0Y1wttDYs6ITQL9cSKQ0HpdSho2PL0x1uqgQB0zA2sCYK3LKVI6
qUk38VbZR/p+DJrqGLqlOrb3vZl2USvMkZVsOj5NuuoOHyAnCS0W6aTmoT/RUOv2
DVoOvXE4mkUQDgmGsNUV5sU0PsO0p9KicA23U9cU+82O+91LlLv1tSn2HT0x/4cG
TPTv86bbGsY+V8L2XPi6vsqp1UTAMA1IO/H/p9N0K2LUojiSwkDRqQ==
=1c79
-----END PGP SIGNATURE-----