On Mon, Jul 7, 2008 at 4:48 AM, Dave Korn <[EMAIL PROTECTED]> wrote: > Kaveh R. GHAZI wrote on 06 July 2008 23:36: > >> * gcc.c (execute): Fix -Wc++-compat warning. > > > Kaveh, am I right in inferring from recent list traffic that you've taken > on a whole load of c-vs-c++ compatibility work? If so, have you seen / can > you take a look at http://gcc.gnu.org/ml/gcc/2008-07/msg00109.html (and the > follow-up http://gcc.gnu.org/ml/gcc/2008-07/msg00130.html) ?
The idiom is to use XCNEWVAR(T) for xcalloc(1, sizeof(T)), XNEWVAR(T) for xmalloc(sizeof(T)), XNEWVEC(T,n) for xmalloc(n * sizeof(T)), and XCNEWVEC(T,n) for xcalloc(n,sizeof(T)). You don't need to add explicit casts -- those are taken care of by the allocation macros. > > > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > >