This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Fixes to bootstrap from a C++ compiler (part 1)
Mark Mitchell <mark@codesourcery.com> writes:
> I suppose we could introduce a macro along the lines of:
>
> #define ALLOC(bytes, type) \
> ((type *) xmalloc (bytes))
>
> The cast would then be in this one place, making it rather
> non-controversial to include it, I would think.
>
> Or:
>
> #define ALLOC_1(type) \
> ((type *) xmalloc (sizeof (type))
>
> #define ALLOC_N(type, n) \
> ((type *) xmalloc (sizeof (type) * n))
>
> (These have obvious analogues in C++, of course.)
I introduced similar macros in libcpp a long time ago - they were
called xnew and xvecnew, IIRC.
zw