This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Token pasting
- To: Philipp Thomas <pthomas at suse dot de>, Neil Booth <neilb at earthling dot net>, gcc at gcc dot gnu dot org
- Subject: Re: Token pasting
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 8 Jan 2001 11:52:34 +0100
- References: <20010108114401.B22673@jeffreys.suse.de>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jan 08, 2001 at 11:44:02AM +0100, Philipp Thomas wrote:
> Hi Neil,
>
> while compiling latest CVS ALSA drivers with gcc 2.97, I get warnings like
> the following:
>
> warning: pasting "__module_generic_string_info_parm_snd_major" and "[" does not give a valid preprocessing token
>
> this results ultimately from this macro in alsas initval.h:
>
> #define MODULE_GENERIC_STRING(name, string) \
> static const char __module_generic_string_##name## [] \
> __attribute__ ((section(".modstring"))) = #name "=" string;
Use
#define MODULE_GENERIC_STRING(name, string) \
static const char __module_generic_string_##name [] \
__attribute__ ((section(".modstring"))) = #name "=" string;
instead. __module_generic_string_info_parm_snd_major[ is not a valid cpp
token and ISO C99 sais pasting which does not result in a valid
preprocessing token has undefined behaviour.
Jakub