From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4324 invoked by alias); 22 Mar 2010 22:56:54 -0000 Received: (qmail 4315 invoked by uid 22791); 22 Mar 2010 22:56:52 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Mar 2010 22:56:48 +0000 Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id o2MMuk98032235 for ; Mon, 22 Mar 2010 15:56:46 -0700 Received: from wwa36 (wwa36.prod.google.com [10.241.241.36]) by kpbe15.cbf.corp.google.com with ESMTP id o2MMui6F003831 for ; Mon, 22 Mar 2010 15:56:45 -0700 Received: by wwa36 with SMTP id 36so451974wwa.20 for ; Mon, 22 Mar 2010 15:56:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.157.145 with SMTP id o17mr2794507wek.125.1269298603846; Mon, 22 Mar 2010 15:56:43 -0700 (PDT) In-Reply-To: <20100316160632.GC3830@adacore.com> References: <1268599156-23584-1-git-send-email-vapier@gentoo.org> <1268678817-11407-1-git-send-email-vapier@gentoo.org> <20100316160632.GC3830@adacore.com> Date: Mon, 22 Mar 2010 22:56:00 -0000 Message-ID: Subject: Re: [PATCH v2] sim: avoid TRACE redefine warnings From: Doug Evans To: Joel Brobecker Cc: Mike Frysinger , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2010-03/txt/msg00784.txt.bz2 On Tue, Mar 16, 2010 at 9:06 AM, Joel Brobecker wro= te: >> 2010-03-15 =A0Mike Frysinger =A0 >> >> =A0 =A0 =A0 * hw-ports.c (TRACE): Delete. >> =A0 =A0 =A0 * hw-properties.c (TRACE): Delete. >> =A0 =A0 =A0 (hw_find_ihandle_runtime_property): Change TRACE to HW_TRACE. >> =A0 =A0 =A0 (hw_find_integer_property): Likewise. >> =A0 =A0 =A0 (hw_find_integer_array_property): Likewise. >> =A0 =A0 =A0 (hw_add_duplicate_property): Likewise. > > This looks good to me. I don't understand why people use two parentheses > in the call to HW_TRACE: > > =A0 =A0HW_TRACE ((me, [...], property)) > > But it looks like it's the style being used, so OK. For reference sake, It's not style, it's correctness. Having two parens allows for variadic macros in the absence of explicit support from the language. void hw_trace (struct hw *me, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); #define HW_TRACE(ARGS) \ do { \ if (hw_trace_p (me)) \ { \ hw_trace ARGS; \ } \ } while (0)