This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Fix PR11025
- From: Ian Lance Taylor <iant at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: Binutils <binutils at sourceware dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Fri, 27 Nov 2009 07:59:00 -0800
- Subject: Re: [patch] Fix PR11025
- References: <38a0d8450911270636ta297fabu5dd4524d58e9f4ac@mail.gmail.com>
Rafael Espindola <espindola@google.com> writes:
> The attached patch fixes PR11025. It assumes that long long is 64
> bits, but I think this assumption exists in other places in gold. If
> not, what is the correct way to printf a 64 bit value in c++?
You can safely assume that long long is always at least 64 bits in
size.
> 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
>
> * incremental-dump.cc (main): Use lld to print 64 bit values.
> - printf(" Timestamp sec = %ld\n", input->timestamp_sec);
> + printf(" Timestamp sec = %lld\n",
> + static_cast<unsigned long long>(input->timestamp_sec));
If you cast to "unsigned long long" then you should print with %llu.
This is OK with that change.
Thanks.
Ian