]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.16] runtime/cgo: add cast in C code to avoid C compiler warning
authorIan Lance Taylor <iant@golang.org>
Wed, 17 Feb 2021 20:03:13 +0000 (12:03 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 18 Feb 2021 03:06:52 +0000 (03:06 +0000)
For #44340
Fixes #44346

Change-Id: Id80dd1f44a988b653933732afcc8e49a826affc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/293209
Reviewed-by: Andrew G. Morgan <agm@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 07ef3135253321176704bce6e629a07ac02bf1c6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/293411
TryBot-Result: Go Bot <gobot@golang.org>

src/runtime/cgo/linux_syscall.c

index 56f3d67d8bf670dbc3ca7a1867900d59aced2705..59761c8b409ef2f5da5121dae80fb26374fe3157 100644 (file)
@@ -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