From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10261 invoked by alias); 23 Jun 2015 20:07:20 -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 10251 invoked by uid 89); 23 Jun 2015 20:07:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f174.google.com Received: from mail-ob0-f174.google.com (HELO mail-ob0-f174.google.com) (209.85.214.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 23 Jun 2015 20:07:18 +0000 Received: by obbkm3 with SMTP id km3so13628762obb.1 for ; Tue, 23 Jun 2015 13:07:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=JO4uUYPvYyvGJQkXBb6LaTj49x8f6SXyZcJGF7KJQZk=; b=FaMGqHrfiAh8astR7F+dtRCBWK5dvacicDlByyKoEPEqPnpxswAe7OYoTK2+75Ejqo frHMkGlDHiJxF4SLrQc87pbVjF91ojPGLCQ1MVvAuTsN2/c9A8XWCUX2LojT2lio3nhQ vMFB6rhuOFvndF2PADFScnVVb/OAcr2NHHuESEi1z4wXsTRpeKyl3EmZR7YrR1VU3ZCC gtl6suTUIGz+FHD39oLgfw5qsXuQjjH4nKHywX++2qlH+DJTKT+uJGvzmOB9cNrvs/ha kXq5yaIa21pU+Yzh5mJnlxSmhtBLoF8nLGdikcCDrr0JIHEMnCnBNu9MEtoloI6rMDhk xKHQ== X-Gm-Message-State: ALoCoQlUbRFzakeMBgb2Q15olLZ43IBpGlbUvtpL+1LPA7M1hflLVmOQ6DI5CKwWQLrVT53C4Tjn MIME-Version: 1.0 X-Received: by 10.182.40.165 with SMTP id y5mr31448080obk.21.1435090037095; Tue, 23 Jun 2015 13:07:17 -0700 (PDT) Received: by 10.182.89.99 with HTTP; Tue, 23 Jun 2015 13:07:16 -0700 (PDT) In-Reply-To: <20150623195832.GK17734@vapier> References: <1434909729-6766-1-git-send-email-vapier@gentoo.org> <20150623162145.GI17734@vapier> <20150623195832.GK17734@vapier> Date: Tue, 23 Jun 2015 20:07:00 -0000 Message-ID: Subject: Re: [PATCH/RFC] sim: common: add PRI printf defines From: Doug Evans To: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00505.txt.bz2 On Tue, Jun 23, 2015 at 2:58 PM, Mike Frysinger wrote: > On 23 Jun 2015 11:28, Doug Evans wrote: >> On Tue, Jun 23, 2015 at 11:21 AM, Mike Frysinger wrote: >> > On 22 Jun 2015 17:29, Doug Evans wrote: >> >> On Sun, Jun 21, 2015 at 1:02 PM, Mike Frysinger wrote: >> >> > Keeping track of the right printf formats for the various types can be >> >> > a pretty big hassle, especially in common code which has to support a >> >> > variety of bitsizes. Take a page from the existing standards and add >> >> > a set of PRI macros which hide the details in a common header. >> >> > --- >> >> > sim/common/ChangeLog | 8 ++++++++ >> >> > sim/common/sim-types.h | 21 +++++++++++++++++++++ >> >> > 2 files changed, 29 insertions(+) >> >> > >> >> > diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog >> >> > index 722ad98..db67a1d 100644 >> >> > --- a/sim/common/ChangeLog >> >> > +++ b/sim/common/ChangeLog >> >> > @@ -1,5 +1,13 @@ >> >> > 2015-06-21 Mike Frysinger >> >> > >> >> > + * sim-types.h (_SIM_PRI_TB, __SIM_PRI_TB): New helper macros for >> >> > + expanding target bitsizes into standard PRI formats. >> >> > + (PRI_TW, PRIiTW, PRIxTW): New PRI target word defines. >> >> > + (PRI_TA, PRIiTA, PRIxTA): New PRI target address defines. >> >> > + (PRI_TF, PRIiTF, PRIxTF): New PRI target floating point defines. >> >> > + >> >> >> >> It's not that big a deal, but _[_A-Z]+ is reserved for the compiler. >> > >> > i'm aware of that rule, but it hasn't really stopped us in the code base from >> > using the _xxx namespace. the sim-bits.h header in particular uses this to mark >> > the internal macros as such. >> > >> > i'm certainly open to a diff convention of clearly conveying "this is internal" >> > if gdb has such a thing. although it too uses _xxx in a few places :). >> >> How about a rule saying to avoid _[_A-Z] going forward, >> and we'll fix the existing cases if/when we get to them. >> ? > > what's the proposed replacement ? :) > > GDB__XXX & SIM__XXX ? > -mike Hi. I didn't want to impose anything, sometimes the leading _ can just be removed. For the current patch, SIM__XXX is fine with me. [if it's important to use something that denotes these as being local to the file. Anything beginning with SIM_ would be fine I think.]