This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: `Cpp: 'ICOM_FN(##xfn)' generates a warning :-(
- To: Francois Gouget <fgouget at free dot fr>
- Subject: Re: `Cpp: 'ICOM_FN(##xfn)' generates a warning :-(
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 03 Jan 2001 09:50:09 -0200
- Cc: gcc at gcc dot gnu dot org, jakub at redhat dot com
- Organization: GCC Team, Red Hat
- References: <Pine.LNX.4.21.0101021245530.31144-100000@amboise.dolphin>
On Jan 2, 2001, Francois Gouget <fgouget@free.fr> wrote:
> #define DECLARE2(xfn) void ICOM_FN(##xfn) (void);
This doesn't produce a valid token after token pasting. CVS GCC is
correct in warning about it.
I think an ISO C-compliant solution would be to define DECLARE2 so
that it takes an additional empty argument, and use token pasting to
paste this empty argument to the symbol name.
#define DECLARE2(xfn,empty) void ICOM_FN(empty ## xfn) (void);
DECLARE2(GetObject,)
The alternative I see to preserve the interface of DECLARE2 is to not
use ICOM_FN, but instead concatenate fn with xfn explicitly.
I don't know if any of these are viable alternatives for Wine.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me