]> sourceware.org Git - glibc.git/commitdiff
Fix nptl/tst-cancel-self-cancelstate.c warning.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 26 Nov 2014 16:07:39 +0000 (16:07 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 26 Nov 2014 16:07:39 +0000 (16:07 +0000)
This patch fixes "../sysdeps/nptl/pthread.h:670:26: warning:
initialization discards 'volatile' qualifier from pointer target type"
arising when building nptl/tst-cancel-self-cancelstate.c.  The problem
is passing a volatile int * to a macro expecting void *; the patch
adds an explicit cast.

Tested for x86_64.

* nptl/tst-cancel-self-cancelstate.c (do_test): Cast argument of
pthread_cleanup_push to void *.

ChangeLog
nptl/tst-cancel-self-cancelstate.c

index f43cb09c9f232bdeb922176283750c76116e84a7..0797a15123b673079188182a3e5305b35008679c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-11-26  Joseph Myers  <joseph@codesourcery.com>
 
+       * nptl/tst-cancel-self-cancelstate.c (do_test): Cast argument of
+       pthread_cleanup_push to void *.
+
        * sysdeps/unix/sysv/linux/arm/libc-do-syscall.S (_FORTIFY_SOURCE):
        Undefine.
 
index 3dce967e8f4a3200e23cf97716e9781575652bbf..0defd0b425ef7708b9cdc7578db9495f8255a080 100644 (file)
@@ -29,7 +29,7 @@ do_test (void)
   int ret = 0;
   volatile int should_fail = 1;
 
-  pthread_cleanup_push (cleanup, &should_fail);
+  pthread_cleanup_push (cleanup, (void *) &should_fail);
 
   if ((ret = pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL)) != 0)
     {
This page took 0.123382 seconds and 5 git commands to generate.