Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread fake-use alloca()'s return value to quieten -...



details:   https://anonhg.NetBSD.org/src/rev/a7a3c39a250c
branches:  trunk
changeset: 982421:a7a3c39a250c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Apr 13 00:31:54 2021 +0000

description:
fake-use alloca()'s return value to quieten -Werror=unused-result

diffstat:

 lib/libpthread/pthread.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 32c43335a817 -r a7a3c39a250c lib/libpthread/pthread.c
--- a/lib/libpthread/pthread.c  Tue Apr 13 00:29:42 2021 +0000
+++ b/lib/libpthread/pthread.c  Tue Apr 13 00:31:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread.c,v 1.178 2020/07/22 01:24:39 msaitoh Exp $    */
+/*     $NetBSD: pthread.c,v 1.179 2021/04/13 00:31:54 mrg Exp $        */
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.178 2020/07/22 01:24:39 msaitoh Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.179 2021/04/13 00:31:54 mrg Exp $");
 
 #define        __EXPOSE_STACK  1
 
@@ -535,6 +535,7 @@
 {
        pthread_t self;
        void *retval;
+       void *junk __unused;
 
        self = cookie;
 
@@ -544,7 +545,7 @@
         * be allocating stacks on fixed 2MB boundaries.  Needs a
         * thread register or decent thread local storage.
         */
-       (void)alloca(((unsigned)self->pt_lid & 7) << 8);
+       junk = alloca(((unsigned)self->pt_lid & 7) << 8);
 
        if (self->pt_name != NULL) {
                pthread_mutex_lock(&self->pt_lock);



Home | Main Index | Thread Index | Old Index