From 1a7e9af1536280fc90a9adea9c3ae5b4be968898 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 17 Feb 2021 12:03:13 -0800 Subject: [release-branch.go1.16] runtime/cgo: add cast in C code to avoid C compiler warning For #44340 Fixes #44346 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 (cherry picked from commit 07ef3135253321176704bce6e629a07ac02bf1c6) Reviewed-on: https://go-review.googlesource.com/c/go/+/293411 TryBot-Result: Go Bot --- 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 56f3d67d8b..59761c8b40 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 -- cgit v1.2.3-54-g00ecf