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: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Wed, 3 Jan 2001 12:37:21 +0000
- Cc: gcc at gcc dot gnu dot org, jakub at redhat dot com
- References: <Pine.LNX.4.21.0101021245530.31144-100000@amboise.dolphin>
Francois Gouget wrote:-
> #define DECLARE2(xfn) void ICOM_FN(##xfn) (void);
>
> I expect to get (blank and not relevant lines removed):
>
> void fnGetObject (void);
>
> But more recent versions work again so this seems to be fixed. But I
> still get the following warning:
> test.c:11:1: warning: pasting "(" and "GetObject" does not give a valid
> preprocessing token
>
> Is this use of '##' still going to be supported in the future?
No. GCC in future versions may even upgrade this warning to a hard
error.
> Is it possible to not issue a warning in this situation (I know about
> the macro vararg problem).
No. There may be other ways to achieve what you want; e.g. having an
extra empty argument and pasting that, or making it a varargs argument
if you don't want to have to enter the comma in invocations.
Neil.