This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] dwarf2read.c: Don't assume uint32_t is unsigned int on all hosts.
- From: Doug Evans <dje at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Joel Brobecker <brobecker at adacore dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 23 May 2013 09:06:02 -0700
- Subject: Re: [PATCH] dwarf2read.c: Don't assume uint32_t is unsigned int on all hosts.
- References: <20130521203421 dot 23721 dot 93618 dot stgit at brno dot lan> <CADPb22TzeQEanUGOMcFBJrStDYkk5zRUE2Fht_c_d5mQAYM7sw at mail dot gmail dot com> <519C932E dot 7000601 at redhat dot com> <CADPb22S0sYeTv+9_gsNO=3axHabLjgtwuyuNpyniLUfwwv9aCQ at mail dot gmail dot com> <519CEDF9 dot 7060000 at redhat dot com> <CADPb22Tw2b788uihCJjjnmKKGjgm525vmpThMzEHZ0fpSTqgzw at mail dot gmail dot com> <20130523055353 dot GC4017 at adacore dot com> <519E0484 dot 9040103 at redhat dot com> <87a9nlg5gt dot fsf at fleche dot redhat dot com>
On Thu, May 23, 2013 at 7:01 AM, Tom Tromey <tromey@redhat.com> wrote:
> Pedro> #1 - Use inttypes.h format specifiers
> Pedro> PRId16/PRId32/PRIu16/PRIu32/PRIx16/PRIx32 etc. We import
> Pedro> inttypes from gnulib, so these are always available.
>
> I find these pretty incomprehensible, but I would adapt.
> One virtue of using these is that they are standard; and the more
> standard the code is, the less newcomers have to learn.
>
> Pedro> #2 - plongest/pulongest, and let the compiler zero/sign extend.
> Pedro> For hex printing use phex/phex_nz.
>
> This is my preference, I think primarily due to parsimony.
> In this case, for me, that outweighs the standards-based argument,
> because the overhead of learning about pulongest is low.
It's not obvious to me to use pulongest to print uint32_t,
so if y'all are willing to let me check in a patch that is otherwise obvious
but happens to not use pulongest ... "works for me".
['cus I can't promise to keep this one in cache]