This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [top-level] C++-friendly allocators for libiberty
Alexandre Oliva wrote:
> On Jun 26, 2004, Bernardo Innocenti <bernie@develer.com> wrote:
>
>> #define foo ,
>> xresize(struct foo, f, 10);
>
>>...but how could one possibly abuse this to generate code
>>that actually compiles?
>
> If it's C++, one could overload xrealloc. I tend to prefer to enclose
> all macro arguments in parentheses, even when not strictly necessary,
> than to risk missing one case.
OK, better safe than sorry, I guess.
> And, as Falk pointed out, the full expansion of the macro should be
> enclosed in parentheses as well.
Done already.
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/