Ethereal-dev: Re: [Ethereal-dev] cpp warnings in packet-prism.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Mon, 2 Dec 2002 18:14:39 -0800
On Tue, Dec 03, 2002 at 03:00:27AM +0100, Joerg Mayer wrote:
> packet-prism.c:173:48: warning: pasting "." and "msgcode" does not give a valid preprocessing token

At least from the way I read the ANSI C standard:

	1) the result of the "##" preprocessing operator must be a
	   "preprocessing token" ("3.8.3.3 The ## Operator");

	2) "hdr.msgcode" is not a valid preprocessing token ("3.1
	   Lexical Elements"),

E.g., you can use "##" to glue "foo_" and "bar" together to make
"foo_bar", but you can't use it to glue "foo." and "bar" together to
make "foo.bar".  (Perhaps it'll work in some compilers - perhaps even in
most compilers - but the ANSI C standard doesn't require it to work, at
least as I read it).