aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov-tool.c
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2015-01-09 00:50:49 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2015-01-09 00:50:49 +0000
commite608ef6de92f53558b27b3166d5da5ea3725461d (patch)
treee8ae9d3d6090dc578c6e59d674449af82c781c4e /gcc/gcov-tool.c
parentfe7d7447470fb9e66bd007a6f8353a8718676479 (diff)
downloadgcc-e608ef6de92f53558b27b3166d5da5ea3725461d.zip
gcc-e608ef6de92f53558b27b3166d5da5ea3725461d.tar.gz
gcc-e608ef6de92f53558b27b3166d5da5ea3725461d.tar.bz2
re PR gcov-profile/61790 (gcov-tool.c uses atoll)
PR gcov-profile/61790 * gcov-tool.c (do_rewrite): Use strtoll instead of atoll if host has long long. Fallback to int64_t if host doesn't have long long and use strtol if int64_t is long. Otherwise, use sscanf for conversion. From-SVN: r219372
Diffstat (limited to 'gcc/gcov-tool.c')
-rw-r--r--gcc/gcov-tool.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c
index 1268986..7de175f 100644
--- a/gcc/gcov-tool.c
+++ b/gcc/gcov-tool.c
@@ -289,7 +289,11 @@ do_rewrite (int argc, char **argv)
int opt;
int ret;
const char *output_dir = 0;
+#ifdef HAVE_LONG_LONG
long long normalize_val = 0;
+#else
+ int64_t normalize_val = 0;
+#endif
float scale = 0.0;
int numerator = 1;
int denominator = 1;
@@ -309,7 +313,13 @@ do_rewrite (int argc, char **argv)
break;
case 'n':
if (!do_scaling)
- normalize_val = atoll (optarg);
+#if defined(HAVE_LONG_LONG)
+ normalize_val = strtoll (optarg, (char **)NULL, 10);
+#elif defined(INT64_T_IS_LONG)
+ normalize_val = strtol (optarg, (char **)NULL, 10);
+#else
+ sscanf (optarg, "%" SCNd64, &normalize_val);
+#endif
else
fnotice (stderr, "scaling cannot co-exist with normalization,"
" skipping\n");