public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2784] gcov: Remove <stdint.h> from libgcov-driver.c
@ 2021-08-06 10:28 Sebastian Huber
0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2021-08-06 10:28 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3c94db20be9af3cb0376292e2d4672b515558231
commit r12-2784-g3c94db20be9af3cb0376292e2d4672b515558231
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Fri Aug 6 09:57:43 2021 +0200
gcov: Remove <stdint.h> from libgcov-driver.c
In the patch to add __gcov_info_to_gcda(), the include of <stdint.h> was added
to libgcov-driver.c even if inhibit_libc is defined. It turned out that this
header file is not always available. Remove the include of <stdint.h> and
replace the intptr_t with the compiler provided __INTPTR_TYPE__.
libgcc/
* libgcov-driver.c (#include <stdint.h>): Remove.
(write_topn_counters): Use __INTPTR_TYPE__ instead of intptr_t.
Diff:
---
libgcc/libgcov-driver.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c
index 9d7bc9c7995..087f71e0107 100644
--- a/libgcc/libgcov-driver.c
+++ b/libgcc/libgcov-driver.c
@@ -26,8 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libgcov.h"
#include "gcov-io.h"
-#include <stdint.h>
-
/* Return 1, if all counter values are zero, otherwise 0. */
static inline int
@@ -453,7 +451,7 @@ write_topn_counters (const struct gcov_ctr_info *ci_ptr,
gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2];
unsigned sizes = 0;
- for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start;
+ for (struct gcov_kvp *node = (struct gcov_kvp *)(__INTPTR_TYPE__)start;
node != NULL; node = node->next)
++sizes;
@@ -472,7 +470,7 @@ write_topn_counters (const struct gcov_ctr_info *ci_ptr,
gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2];
unsigned j = 0;
- for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start;
+ for (struct gcov_kvp *node = (struct gcov_kvp *)(__INTPTR_TYPE__)start;
j < list_sizes[i]; node = node->next, j++)
{
dump_counter (node->value, dump_fn, arg);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-06 10:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 10:28 [gcc r12-2784] gcov: Remove <stdint.h> from libgcov-driver.c Sebastian Huber
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).