[gcc r10-9424] runtime: cast SIGSTKSZ to uintptr

Ian Lance Taylor ian@gcc.gnu.org
Tue Mar 9 00:17:21 GMT 2021


https://gcc.gnu.org/g:3c8e29c81b789db8a49616e0d36d16f869cf442a

commit r10-9424-g3c8e29c81b789db8a49616e0d36d16f869cf442a
Author: Ian Lance Taylor <iant@golang.org>
Date:   Mon Mar 8 15:23:40 2021 -0800

    runtime: cast SIGSTKSZ to uintptr
    
            PR go/99458
            * libgo/runtime/proc.c: cast SIGSTKSZ to uintptr
            In newer versions of glibc it is long, which causes a signed
            comparison warning.

Diff:
---
 libgo/runtime/proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 274ce01c0bf..6f7d2e27996 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -799,8 +799,8 @@ runtime_malg(bool allocatestack, bool signalstack, byte** ret_stack, uintptr* re
 		if(signalstack) {
 			stacksize = 32 * 1024; // OS X wants >= 8K, GNU/Linux >= 2K
 #ifdef SIGSTKSZ
-			if(stacksize < SIGSTKSZ)
-				stacksize = SIGSTKSZ;
+			if(stacksize < (uintptr)(SIGSTKSZ))
+				stacksize = (uintptr)(SIGSTKSZ);
 #endif
 		}


More information about the Gcc-cvs mailing list