This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Parametrized macro names
- From: Fabio Alemagna <falemagn at studenti dot unina dot it>
- To: Tom Lord <lord at emf dot net>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Wed, 5 Mar 2003 05:14:17 +0100 (CET)
- Subject: Re: [RFC] Parametrized macro names
On Tue, 4 Mar 2003, Tom Lord wrote:
> [...]
>
> (Regarding the "one more thing" -- it could easily break existing
> code. One might expect differently, but then one would be wrong. :-)
Ok, that's true, hand't thought of that.
> Putting that all together, you seem to want users of your macros
> to be able use some combination of the strings:
>
> macro param1 param2 ... paramN
>
> in some CPP construct to produce a string which is parameterized
> by strings
>
> bodyparam1 bodyparam2 ... bodyparamN
>
> [...]
>
> Now what if you want to use a bodyparamK _inside_ a ## expression?
> No problem: you can define
>
> #define bodyparamK_val(p1, p2) bodyparamK_ ## p1 ## p2
>
> and use that instead.
>
> [...]
Hum, no, that's actually the opposite of what I want to do: I *don't* want
to write the bodyparamL_etc_etc_etc macro, I want the preprocessor to work
it out for me, so that when I use bodyparamK_val() it can find the right
macro without me having to write all combinations of it.
But then, given the fact that it would break compatibility with existing
code, let's forget about it.
Fabio Alemagna