From: Alberto Donizetti Date: Wed, 16 May 2018 09:43:02 +0000 (+0200) Subject: runtime/cgo: use size_t in sizeof result comparison X-Git-Tag: go1.11beta1~411 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4102e6ff56eee8fd6a1689f4bcf9d5a92cc44a6c;p=gostls13.git runtime/cgo: use size_t in sizeof result comparison When a variable of type int is compared with sizeof's return value, gcc warns: comparison between signed and unsigned integer expressions Change the type of a couple loop indices that looped over sizeof from int to size_t to silence the warnings. Fixes #25411 Change-Id: I2c7858f84237e77945651c7b1b6a75b97edcef65 Reviewed-on: https://go-review.googlesource.com/113335 Run-TryBot: Alberto Donizetti TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/cgo/gcc_freebsd_sigaction.c b/src/runtime/cgo/gcc_freebsd_sigaction.c index d1bf3c0b52..98b122d75e 100644 --- a/src/runtime/cgo/gcc_freebsd_sigaction.c +++ b/src/runtime/cgo/gcc_freebsd_sigaction.c @@ -29,7 +29,7 @@ x_cgo_sigaction(intptr_t signum, const go_sigaction_t *goact, go_sigaction_t *ol int32_t ret; struct sigaction act; struct sigaction oldact; - int i; + size_t i; _cgo_tsan_acquire(); diff --git a/src/runtime/cgo/gcc_sigaction.c b/src/runtime/cgo/gcc_sigaction.c index 05dee2affe..e510e359fe 100644 --- a/src/runtime/cgo/gcc_sigaction.c +++ b/src/runtime/cgo/gcc_sigaction.c @@ -33,7 +33,7 @@ x_cgo_sigaction(intptr_t signum, const go_sigaction_t *goact, go_sigaction_t *ol int32_t ret; struct sigaction act; struct sigaction oldact; - int i; + size_t i; _cgo_tsan_acquire();