From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16293 invoked by alias); 26 Jun 2004 11:19:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16259 invoked from network); 26 Jun 2004 11:18:57 -0000 Received: from unknown (HELO mx5.informatik.uni-tuebingen.de) (134.2.12.32) by sourceware.org with SMTP; 26 Jun 2004 11:18:57 -0000 Received: from localhost (loopback [127.0.0.1]) by mx5.informatik.uni-tuebingen.de (Postfix) with ESMTP id 6DF3811C; Sat, 26 Jun 2004 13:18:56 +0200 (MST) Received: from mx5.informatik.uni-tuebingen.de ([127.0.0.1]) by localhost (mx5 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23910-05; Sat, 26 Jun 2004 13:18:54 +0200 (DFT) Received: from juist (semeai.Informatik.Uni-Tuebingen.De [134.2.15.66]) by mx5.informatik.uni-tuebingen.de (Postfix) with ESMTP id 25082113; Sat, 26 Jun 2004 13:18:54 +0200 (MST) Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 1BeBCv-0001cl-00; Sat, 26 Jun 2004 13:18:53 +0200 To: Zack Weinberg Cc: Alexandre Oliva , Bernardo Innocenti , Ian Lance Taylor , GCC Patches , gdb-patches@sources.redhat.com, binutils@sources.redhat.com, DJ Delorie Subject: Re: [top-level] C++-friendly allocators for libiberty References: <40DCC86A.4010306@develer.com> <40DCD0EE.9010208@develer.com> <40DCE1C8.4020202@develer.com> <87wu1u7w8w.fsf@taltos.codesourcery.com> From: Falk Hueffner Date: Sat, 26 Jun 2004 11:19:00 -0000 In-Reply-To: <87wu1u7w8w.fsf@taltos.codesourcery.com> (Zack Weinberg's message of "Fri, 25 Jun 2004 21:56:31 -0700") Message-ID: <87wu1uo9cy.fsf@informatik.uni-tuebingen.de> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (cabbage, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (McAfee AntiVirus) at informatik.uni-tuebingen.de X-SW-Source: 2004-06/txt/msg00559.txt.bz2 Zack Weinberg writes: > Alexandre Oliva 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 write &xnew(T)->el 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 of parentheses. -- Falk