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: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Doug Evans <dje at google dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 23 May 2013 08:01:54 -0600
- 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>
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.
Tom