From 07ef3135253321176704bce6e629a07ac02bf1c6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 17 Feb 2021 12:03:13 -0800 Subject: [PATCH] runtime/cgo: add cast in C code to avoid C compiler warning Fixes #44340 Change-Id: Id80dd1f44a988b653933732afcc8e49a826affc4 Reviewed-on: https://go-review.googlesource.com/c/go/+/293209 Reviewed-by: Andrew G. Morgan Reviewed-by: Bryan C. Mills Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor --- src/runtime/cgo/linux_syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/cgo/linux_syscall.c b/src/runtime/cgo/linux_syscall.c index 56f3d67d8bf..59761c8b409 100644 --- a/src/runtime/cgo/linux_syscall.c +++ b/src/runtime/cgo/linux_syscall.c @@ -32,7 +32,7 @@ typedef struct { #define SET_RETVAL(fn) \ uintptr_t ret = (uintptr_t) fn ; \ - if (ret == -1) { \ + if (ret == (uintptr_t) -1) { \ x->retval = (uintptr_t) errno; \ } else \ x->retval = ret