From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92670 invoked by alias); 23 Jun 2015 16:21:49 -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 92660 invoked by uid 89); 23 Jun 2015 16:21:49 -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 16:21:48 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 487F23408EE; Tue, 23 Jun 2015 16:21:46 +0000 (UTC) Date: Tue, 23 Jun 2015 16:21:00 -0000 From: Mike Frysinger To: Doug Evans Cc: gdb-patches Subject: Re: [PATCH/RFC] sim: common: add PRI printf defines Message-ID: <20150623162145.GI17734@vapier> Mail-Followup-To: Doug Evans , gdb-patches References: <1434909729-6766-1-git-send-email-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6lXr1rPCNTf1w0X8" Content-Disposition: inline In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00482.txt.bz2 --6lXr1rPCNTf1w0X8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1571 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. > > + >=20 > 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 fr= om=20 using the _xxx namespace. the sim-bits.h header in particular uses this to= mark=20 the internal macros as such. i'm certainly open to a diff convention of clearly conveying "this is inter= nal"=20 if gdb has such a thing. although it too uses _xxx in a few places :). -mike --6lXr1rPCNTf1w0X8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJViYeZAAoJEEFjO5/oN/WBXI4P/A+9RZbj9zZLqo0tssbR1+Co X+YcmnamiawuhsDAV3OSXH0d3j4YdqiZVy3TDuuhDpdb3kcUARBsSgQBJttk7aA0 /6PjnGbtlQxh0Ln8jExDoAFcotKQ1W59NNRRf29dEXTMSeGOWtUJzkmcnEosxvHJ 5t2qtQxOwUDgPB6EFuh5zAQ5giqjv5ZTl2aycmCm1MHwN4L7HR1mTGOBNVfcOugM FrR0xW4yiGttSCNrQGykYv+aDuPODsmVH1qao9eK7pOvvvOnK3QVdc1QpRgehmdi znbsJP33f8YIpbLlLfeka9ER54KALNOchbgXM/03mzMFaZbfY0JxSnxSDXP/dz4P MaUvvbLL1fFvDPa+4839ck0WctuAlgjEeD/CTTHAhaiGMawnv6yzckxAKvnLR5Cu slYR3ScOk19UCTeDiNarRIzeq5XjHxM23GyKhH68JcZxMkHJW9IfpdaLaWC1Kv8G g1h969RDwBqG8+DeduHcB/wOrvI44ZNVwbO+eifRDlS9w/gLVKQMVffddjCM85D0 7xib7zI40fzdvcb4HZAv08NUEyplpSPcPlAt14YOp3OzEt1eKUBSeNQZO0Pz2+gS 7wkGxT5cJBF3g7cfxw5XyJGaMwxlPs/85VAiIVilL9ED01bVVr2zPHNUENeIJq7x KtEk1MD9JOiJiv4ef1Xu =2IL/ -----END PGP SIGNATURE----- --6lXr1rPCNTf1w0X8--