From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115845 invoked by alias); 23 Jun 2015 19:58:36 -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 115833 invoked by uid 89); 23 Jun 2015 19:58:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 23 Jun 2015 19:58:34 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 8F1053408AB; Tue, 23 Jun 2015 19:58:32 +0000 (UTC) Date: Tue, 23 Jun 2015 19:58:00 -0000 From: Mike Frysinger To: Doug Evans Cc: gdb-patches Subject: Re: [PATCH/RFC] sim: common: add PRI printf defines Message-ID: <20150623195832.GK17734@vapier> Mail-Followup-To: Doug Evans , gdb-patches References: <1434909729-6766-1-git-send-email-vapier@gentoo.org> <20150623162145.GI17734@vapier> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/0U0QBNx7JIUZLHm" Content-Disposition: inline In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00504.txt.bz2 --/0U0QBNx7JIUZLHm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1955 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 defi= nes. > >> > + > >> > >> 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 bas= e from > > using the _xxx namespace. the sim-bits.h header in particular uses thi= s to mark > > the internal macros as such. > > > > i'm certainly open to a diff convention of clearly conveying "this is i= nternal" > > if gdb has such a thing. although it too uses _xxx in a few places :). >=20 > 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 --/0U0QBNx7JIUZLHm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVibpoAAoJEEFjO5/oN/WBBNQQAJCQC69SQa8faOZhsmKaTaOH Uc7oj1W3Ng3L1PUs5PGbr/HY9Ta22v56YRU7aK5wM4Dr9lgrVOnbkRMKAHXrS9VO NYz6I8O3BIoYJ4j3nfgOd3VQ9NtrnTS9jttF0eKjMarcDLGYybUzzO0kNvFYORib 06tvcNdsiFDllNqpdHkTzHbLo9ZJiRRbwvqI8xrJzIBNGYmkF8mQEmzeyIfzdlST 4J+BptBBcyzXx2cpiOdJgMXRw0agfw9ONdyTnw0ibXS50lo04dE1VvMCH38vdlHG pUs/5oQbFMirbuc11pI0JFC1M0OvOpycrcTaMl49BLZlYoAazHQPLHBIauQkrYE9 kKQZ4mZ0Xb2BcPQAZBsos1K5L8t+X1rinahgF4xBj9IpjzbYaTjYZRbb3gP7HjwM c2oxe1pGVS+zLuBGEnFDxOuskNFANNqX5AZ69GAMgYQg4bzcOCD0HjtKv22DheD7 r91ZO7NgyCbJmcpKWxPGfH4u34vhScizsO1JAUaFftqIyvMi1cxdrzbci7gDkwv5 vznGd8pEtoAZEuhTBRm+LtTSeA9PVLj5gT612kgObTbFdvV8mzAuF1b5Zp7ubb6N wyH5ingdqXtv1qLJPp8JcNyMNnqi0iE+jiq2NyOkssjr8e1om8awzTo84F0P0661 BPaG2sQNHo4UGoYNzA5E =tque -----END PGP SIGNATURE----- --/0U0QBNx7JIUZLHm--