1
0
mirror of https://github.com/golang/go synced 2024-11-24 03:50:18 -07:00

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 <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Alberto Donizetti 2018-05-16 11:43:02 +02:00
parent 3868a371a8
commit 4102e6ff56
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -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();