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
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}