From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28735 invoked by alias); 26 Jun 2004 04:18:27 -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 28658 invoked from network); 26 Jun 2004 04:18:22 -0000 Received: from unknown (HELO develer.com) (151.38.19.110) by sourceware.org with SMTP; 26 Jun 2004 04:18:22 -0000 Received: (qmail 3314 invoked from network); 26 Jun 2004 04:18:02 -0000 Received: from beetle.trilan (HELO ?10.3.2.254?) (?P/v4eTeoSkW6T7IZwL4ZN6lJmRgpsC4h?@10.3.2.254) by trinity.trilan with SMTP; 26 Jun 2004 04:18:02 -0000 Message-ID: <40DCF8FA.4090700@develer.com> Date: Sat, 26 Jun 2004 04:18:00 -0000 From: Bernardo Innocenti Organization: Develer S.r.l. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040622 MIME-Version: 1.0 To: Alexandre Oliva CC: 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> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00551.txt.bz2 Alexandre Oliva wrote: > On Jun 25, 2004, Bernardo Innocenti wrote: > > >>+#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. I had used them the first time, but then removed them because I thought there would be no way to pass an argument containing a comma through the C89 preprocessor. Actually, there's: #define foo , xresize(struct foo, f, 10); ...but how could one possibly abuse this to generate code that actually compiles? -- // Bernardo Innocenti - Develer S.r.l., R&D dept. \X/ http://www.develer.com/