[top-level] C++-friendly allocators for libiberty

Alexandre Oliva aoliva@redhat.com
Sat Jun 26 18:31:00 GMT 2004


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.

And, as Falk pointed out, the full expansion of the macro should be
enclosed in parentheses as well.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the Gdb-patches mailing list