From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8445 invoked by alias); 1 Oct 2013 16:34:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 8426 invoked by uid 89); 1 Oct 2013 16:34:02 -0000 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 01 Oct 2013 16:34:02 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D509A116693; Tue, 1 Oct 2013 12:34:18 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nSZPLHQoBGtD; Tue, 1 Oct 2013 12:34:18 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9EAFF11668C; Tue, 1 Oct 2013 12:34:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id C5F38E0499; Tue, 1 Oct 2013 18:33:59 +0200 (CEST) Date: Tue, 01 Oct 2013 16:34:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: "Agovic, Sanimir" , 'Mark Kettenis' , "ooprala@redhat.com" , "gdb-patches@sourceware.org" Subject: Re: C++-compat clean build Message-ID: <20131001163359.GA28649@adacore.com> References: <524AB12E.8090209@redhat.com> <201310011204.r91C4QVo006124@glazunov.sibelius.xs4all.nl> <0377C58828D86C4588AEEC42FC3B85A7176850E2@IRSMSX105.ger.corp.intel.com> <524AD936.7060604@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <524AD936.7060604@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-10/txt/msg00064.txt.bz2 > We have several uses of these macros already in the tree. > They seem to have the advantage that they hide the casts and perhaps > make the intention of the code clearer while we can't use new/new[]. > E.g., XNEW prevents errors of the type: > > struct foo *f = (struct foo *) xmalloc (sizeof (f)); > > We already use these macros in gdb in several places. > Not sure what people feel about using them more? FWIW, I have no real strong opinion. If the casts become necessary, and they allow us to hide them, I think they indeed would be useful. -- Joel