Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a lot of warnings from the compiler #37

Closed
isaacvr opened this issue Oct 31, 2019 · 0 comments
Closed

Getting a lot of warnings from the compiler #37

isaacvr opened this issue Oct 31, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@isaacvr
Copy link

isaacvr commented Oct 31, 2019

Describe the bug
There are a lot of warnings from the compiler

Environment information:

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myuser/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/share/gocode"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build305345991=/tmp/go-build -gno-record-gcc-switches"
  • Compiler info: gcc (Debian 8.3.0-6) 8.3.0

Steps to Reproduce
Steps to reproduce the behavior:

  1. Go to the source project root dir
  2. Run make test-libc

Actual behavior

Getting a lot of warnings:

lib/cgo/tests/check_cipher.crypto.c: In function ‘TestSecKeyFromHex’:
lib/cgo/tests/check_cipher.crypto.c:269:27: warning: passing argument 2 of ‘SKY_cipher_RandByte’ from incompatible pointer type [-Wincompatible-pointer-types]
   SKY_cipher_RandByte(32, &b);
                           ^~
In file included from lib/cgo/tests/check_cipher.crypto.c:5:
cgo-gcc-export-header-prolog:330:62: note: expected ‘coin__UxArray *’ {aka ‘struct <anonymous> *’} but argument is of type ‘GoSlice *’ {aka ‘struct <anonymous> *’}
In file included from lib/cgo/tests/check_cipher.hash.c:4:
lib/cgo/tests/check_cipher.hash.c: In function ‘TestSHA256Hex’:
lib/cgo/tests/check_cipher.hash.c:137:15: warning: implicit declaration of function ‘isGoStringEq’; did you mean ‘isGoSliceEq’? [-Wimplicit-function-declaration]
     ck_assert(isGoStringEq(s, s2));
               ^~~~~~~~~~~~
lib/cgo/tests/check_params.distribution.c: In function ‘TestDistributionAddressArrays’:
lib/cgo/tests/check_params.distribution.c:33:22: warning: assignment to ‘GoString *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘GoString_ *’ {aka ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
     for (i = 0, iStr = (GoString_ *)all.data; i < all.len; ++i, ++iStr)
                      ^
lib/cgo/tests/check_params.distribution.c:42:22: warning: assignment to ‘GoString *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘GoString_ *’ {aka ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
     for (i = 0, iStr = (GoString_ *)unlocked.data; i < unlocked.len; ++i, ++iStr)
                      ^
lib/cgo/tests/check_params.distribution.c:51:40: warning: assignment to ‘GoString *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘GoString_ *’ {aka ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
         for (k = 0, notfound = 1, kStr = (GoString_ *)all.data; notfound && (k < all.len); ++k, ++kStr)
                                        ^
lib/cgo/tests/check_params.distribution.c:58:22: warning: assignment to ‘GoString *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘GoString_ *’ {aka ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
     for (i = 0, iStr = (GoString_ *)locked.data; i < locked.len; ++i, ++iStr)
                      ^
lib/cgo/tests/check_params.distribution.c:67:40: warning: assignment to ‘GoString *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘GoString_ *’ {aka ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
         for (k = 0, notfound = 1, kStr = (GoString_ *)all.data; notfound && k < all.len; ++k, ++kStr)
                                        ^
lib/cgo/tests/check_params.distribution.c:75:40: warning: assignment to ‘GoString *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘GoString_ *’ {aka ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
         for (k = 0, notfound = 1, kStr = (GoString_ *)unlocked.data; notfound && k < unlocked.len; ++k, ++kStr)
.
.
.

Expected behavior
No warning at all

@isaacvr isaacvr added the bug Something isn't working label Oct 31, 2019
@isaacvr isaacvr closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant