git: eb5fd01b53a6 - main - soxstack: slience 32-bit gcc warning
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 08 May 2024 14:54:34 UTC
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=eb5fd01b53a6579f3bd5769ed41964683335a7fc commit eb5fd01b53a6579f3bd5769ed41964683335a7fc Author: Brooks Davis <brooks@FreeBSD.org> AuthorDate: 2024-05-08 14:51:17 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> CommitDate: 2024-05-08 14:51:17 +0000 soxstack: slience 32-bit gcc warning Modern GCC complains when casting pointers to integers of a different size (even a larger one). Switch from uint64_t to uintptr_t which will always be the right size for a stack address instead of maybe being too big. Reviewed by: dchagin, emaste Differential Revision: https://reviews.freebsd.org/D45087 --- tests/sys/vm/soxstack/soxstack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/vm/soxstack/soxstack.c b/tests/sys/vm/soxstack/soxstack.c index ac7c9cf03746..ecb672c1b6dc 100644 --- a/tests/sys/vm/soxstack/soxstack.c +++ b/tests/sys/vm/soxstack/soxstack.c @@ -23,7 +23,7 @@ checkstack(void) struct kinfo_vmentry *freep, *kve; struct kinfo_proc *p; struct procstat *prstat; - uint64_t stack; + uintptr_t stack; int i, cnt; prstat = procstat_open_sysctl(); @@ -33,7 +33,7 @@ checkstack(void) freep = procstat_getvmmap(prstat, p, &cnt); assert(freep != NULL); - stack = (uint64_t)&i; + stack = (uintptr_t)&i; for (i = 0; i < cnt; i++) { kve = &freep[i]; if (stack < kve->kve_start || stack > kve->kve_end)