This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Use sscanf instead of atoll in gcov-tool.c
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: John David Anglin <dave dot anglin at bell dot net>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 15 Sep 2014 11:40:56 +0200
- Subject: Re: [PATCH v2] Use sscanf instead of atoll in gcov-tool.c
- Authentication-results: sourceware.org; auth=none
- References: <BLU437-SMTP106633E3F0A4D95093D51B697C00 at phx dot gbl> <CAFiYyc2Mpwpzr1arzcysrckU59-TUh0L_5PsX0Q3jqEG70-wVA at mail dot gmail dot com> <BLU436-SMTP176E775F706A8F10E34D44B97CB0 at phx dot gbl>
On Sun, Sep 14, 2014 at 9:04 PM, John David Anglin <dave.anglin@bell.net> wrote:
> On 8-Sep-14, at 5:21 AM, Richard Biener wrote:
>
>> On Sun, Sep 7, 2014 at 7:36 PM, John David Anglin <dave.anglin@bell.net>
>> wrote:
>>>
>>> The attached patch fixes bootstrap on hpux which doesn't have the atoll
>>> function.
>>>
>>> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.
>>>
>>> OK for trunk?
>>
>>
>> "ll" is not portable (it's GNU), I think BSD uses "q" and windows may
>> use sth else. I think the code shouldn't use 'long long' but int64_t
>> and the appropriate SCNd64 macros for the sscanf format specifier.
>
>
> Attached is an updated version using the SCNd64 macro. It works fine
> on hpux. The PRI/SCN macrocs are available back to at least hpux10.20.
Ok, I'd be happy to require all hosts having "proper" inttypes.h.
So if it works this way for SCNd64 maybe we can remove the "hand-crafting"
of PRId64 stuff in hwint.h ... (or we have to hand-craft SCNd64 as well...).
After all atoll is C99 as well...
> The other alternative is to use the atoll implementation in read-rtl.c.
Also a possibility. Which would ask for a libiberty implementation
I suppose.
> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.
>
> OK for trunk?
Let's wait for other opinions.
Thanks,
Richard.
> Dave
> --
> John David Anglin dave.anglin@bell.net
>
>