]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: use size_t in sizeof result comparison
authorAlberto Donizetti <alb.donizetti@gmail.com>
Wed, 16 May 2018 09:43:02 +0000 (11:43 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Wed, 16 May 2018 12:01:16 +0000 (12:01 +0000)
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>
src/runtime/cgo/gcc_freebsd_sigaction.c
src/runtime/cgo/gcc_sigaction.c

index d1bf3c0b52a37c9f8b3abbe3c476d3043f4432fe..98b122d75ec609dfb95297f27129a57b7fc4fd21 100644 (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();
 
index 05dee2affe04db8dd83844dd5e912c20670dde89..e510e359fe258e077b6888a4754a64ab4ba71616 100644 (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();