[top-level] C++-friendly allocators for libiberty
Sat Jun 26 11:19:00 GMT 2004
Zack Weinberg <email@example.com> writes:
> Alexandre Oliva <firstname.lastname@example.org> writes:
>>> +#define xcnewvec(T, N) (T *) xcalloc (N, sizeof (T))
>>> +#define xresize(T, P, S) (T *) xrealloc (P, S)
>>> +#define xresizevec(T, P, N) (T *) xrealloc (P, sizeof (T) * (N))
>>> +#define xobnew(O, T) (T *) obstack_alloc (O, sizeof (T))
>> You're missing parentheses around N, P (twice), S and O.
> They're not actually necessary in this context.
How about parentheses around the whole cast? Somebody might want to
Not very likely, but IMHO it's not really worth the trouble to try to
think of every possible or sensible use instead of just adding a bunch
More information about the Gdb-patches