about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--nptl/tst-pthread-getattr.c11
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c6dbb2e817..e30cf048b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2019-07-22  Florian Weimer  <fweimer@redhat.com>
 
+	* nptl/tst-pthread-getattr.c (allocate_and_test): Change return
+	type to uintptr_t.
+	(check_stack_top): Adjust.
+
+2019-07-22  Florian Weimer  <fweimer@redhat.com>
+
 	* sysdeps/unix/sysv/linux/bits/socket.h [__USE_MISC]: Include
 	<linux/sockios.h>.
 
diff --git a/nptl/tst-pthread-getattr.c b/nptl/tst-pthread-getattr.c
index a954778767..e3634ea0a7 100644
--- a/nptl/tst-pthread-getattr.c
+++ b/nptl/tst-pthread-getattr.c
@@ -43,7 +43,7 @@ static size_t pagesize;
 
 /* Check if the page in which TARGET lies is accessible.  This will segfault
    if it fails.  */
-static volatile char *
+static volatile uintptr_t
 allocate_and_test (char *target)
 {
   volatile char *mem = (char *) &mem;
@@ -51,7 +51,7 @@ allocate_and_test (char *target)
   mem = alloca ((size_t) (mem - target));
 
   *mem = 42;
-  return mem;
+  return (uintptr_t) mem;
 }
 
 static int
@@ -84,7 +84,6 @@ check_stack_top (void)
 {
   struct rlimit stack_limit;
   void *stackaddr;
-  volatile void *mem;
   size_t stacksize = 0;
   int ret;
   uintptr_t pagemask = ~(pagesize - 1);
@@ -130,14 +129,14 @@ check_stack_top (void)
      stack and test access there.  It is however sufficient to simply check if
      the top page is accessible, so we target our access halfway up the top
      page.  Thanks Chris Metcalf for this idea.  */
-  mem = allocate_and_test (stackaddr + pagesize / 2);
+  uintptr_t mem = allocate_and_test (stackaddr + pagesize / 2);
 
   /* Before we celebrate, make sure we actually did test the same page.  */
-  if (((uintptr_t) stackaddr & pagemask) != ((uintptr_t) mem & pagemask))
+  if (((uintptr_t) stackaddr & pagemask) != (mem & pagemask))
     {
       printf ("We successfully wrote into the wrong page.\n"
 	      "Expected %#" PRIxPTR ", but got %#" PRIxPTR "\n",
-	      (uintptr_t) stackaddr & pagemask, (uintptr_t) mem & pagemask);
+	      (uintptr_t) stackaddr & pagemask, mem & pagemask);
 
       return 1;
     }