On 8-Sep-14, at 5:21 AM, Richard Biener wrote:

On Sun, Sep 7, 2014 at 7:36 PM, John David Anglin <dave.ang...@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.

The other alternative is to use the atoll implementation in read-rtl.c.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.

OK for trunk?

Dave
--
John David Anglin       dave.ang...@bell.net


2014-09-14  John David Anglin  <dang...@gcc.gnu.org>

        PR gcov-profile/61790
        * gcov-tool.c (do_rewrite): Change normalize_val to int64_t.  Use
        sscanf instead of atoll.

Index: gcov-tool.c
===================================================================
--- gcov-tool.c (revision 215242)
+++ gcov-tool.c (working copy)
@@ -288,7 +288,7 @@
   int opt;
   int ret;
   const char *output_dir = 0;
-  long long normalize_val = 0;
+  int64_t normalize_val = 0;
   float scale = 0.0;
   int numerator = 1;
   int denominator = 1;
@@ -308,7 +308,7 @@
           break;
         case 'n':
           if (!do_scaling)
-            normalize_val = atoll (optarg);
+            sscanf (optarg, "%" SCNd64, &normalize_val);
           else
             fnotice (stderr, "scaling cannot co-exist with normalization,"
                 " skipping\n");

Reply via email to