From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112808 invoked by alias); 23 Jun 2015 16:28:04 -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 112793 invoked by uid 89); 23 Jun 2015 16:28:03 -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-oi0-f43.google.com Received: from mail-oi0-f43.google.com (HELO mail-oi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 23 Jun 2015 16:28:02 +0000 Received: by oigb199 with SMTP id b199so10878740oig.3 for ; Tue, 23 Jun 2015 09:28:00 -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=vb/NHHFVVkFONeN6/+MKx/QyL2vyt5kEwvdqvx5TGSA=; b=KLLpKNQ8Z23XNkqxbbwoYWMfDv9bv1GMNpZooLfbllyeCpSeswrux9KECmdaPQ3Pzr A1rNcBLTyrZSmg5SpurEfruR9/4kTv9AP5r81OYRQ1w01PPQ4ldTavfAaIO8ccz8Wt+J AV0blZ4UpAISKNY3Oz3Vpfgc+MMN54Q0WA7B3ZnnnhqBxneQF8E1Ik9HoOe33L3c23/k NIFWbQLU8RZDrht3IjtCuBGowsFxKquHbFjQ6qnqKveRFI+uksL4/4XlXHuXupqzhnAE CNSyag71A7FUgg4FO+NqqRtPdjiP/eEdnXCoB3GpgDhgCyNd4M9UWDcdoiOTJZLBRCTg CSKw== X-Gm-Message-State: ALoCoQlZV5sCsStxW3rYjGa/8GabshEVpY2aFPVNCRwi0ZkBjHpSv1dkHZtKxsHYNe6Z6fdHBxKp MIME-Version: 1.0 X-Received: by 10.182.153.197 with SMTP id vi5mr30501860obb.28.1435076880858; Tue, 23 Jun 2015 09:28:00 -0700 (PDT) Received: by 10.182.89.99 with HTTP; Tue, 23 Jun 2015 09:28:00 -0700 (PDT) In-Reply-To: <20150623162145.GI17734@vapier> References: <1434909729-6766-1-git-send-email-vapier@gentoo.org> <20150623162145.GI17734@vapier> Date: Tue, 23 Jun 2015 16:28: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/msg00483.txt.bz2 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 :). > -mike How about a rule saying to avoid _[_A-Z] going forward, and we'll fix the existing cases if/when we get to them. ?