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: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 22 May 2013 17:10:33 +0100
- 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>
On 05/22/2013 04:57 PM, Doug Evans wrote:
> On Wed, May 22, 2013 at 2:43 AM, Pedro Alves <palves@redhat.com> wrote:
>> On 05/22/2013 12:35 AM, Doug Evans wrote:
>>> On Tue, May 21, 2013 at 1:34 PM, Pedro Alves <palves@redhat.com> wrote:
>>>> Use pulongest rather than PRIu32, so that the translatable format
>>>> string does not depend on host.
>>
>> ...
>>
>>> Lovely.
>>> Although having to remember to use pulongest to print uint32_t sounds
>>> like a never ending series of headaches.
>>
>> Hmm. Grepping for PRIu in src/intl/ finds lots of hits. Looks like
>> gettext is doing some magic to deal with these. There's still the
>> issue with the fact that we use gnulib's inttypes.h replacement for
>> systems that don't have it, and it's possible gettext's replacements
>> don't match gnulib's... But I'm willing to ignore that.
>>
>> WDYT?
>
> If it's doable, I'd prefer this to pulongest.
OK.
> Another possibility, mentioned for reference sake, would be adding puint32, etc.
Yeah, though I think those would end up implemented as calls to
decimal2str(...,ULONGEST,...) internally anyway.
With pulongest, we don't have to care the width of the variable,
only the sign. I guess I could see that as an advantage, even over
PRIxxx.
> I'm ambivalent on what The Right fix is here.
Me too.
--
Pedro Alves