This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Fixes to bootstrap from a C++ compiler (part 1)
Mark Mitchell <firstname.lastname@example.org> 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.
> #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.