public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: John David Anglin <dave.anglin@bell.net>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v2] Use sscanf instead of atoll in gcov-tool.c
Date: Mon, 15 Sep 2014 10:38:00 -0000	[thread overview]
Message-ID: <CAFiYyc3QPvjE+nA_ZUQHi=PJyNH9qmViP9B_4FQeeKUi1dAvDQ@mail.gmail.com> (raw)
In-Reply-To: <BLU436-SMTP176E775F706A8F10E34D44B97CB0@phx.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
>
>

  reply	other threads:[~2014-09-15 10:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 17:36 [PATCH] " John David Anglin
2014-09-08  9:21 ` Richard Biener
2014-09-14 19:05   ` [PATCH v2] " John David Anglin
2014-09-15 10:38     ` Richard Biener [this message]
2014-11-25  1:36       ` [PATCH v3] Use strtoll " John David Anglin
2014-12-20 23:41         ` John David Anglin
2015-01-08 12:27           ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc3QPvjE+nA_ZUQHi=PJyNH9qmViP9B_4FQeeKUi1dAvDQ@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=dave.anglin@bell.net \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).