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

build warning and test fixes #129

Closed
wants to merge 5 commits into from
Closed

Conversation

yerden
Copy link

@yerden yerden commented Feb 8, 2019

Some small fixes:

  • mask test variables to suppress Go compiler warnings. Currently, we see this:
$ go test
# github.com/bmatsuo/lmdb-go/lmdb_test
./example_test.go:769:6: str declared but not used
./example_test.go:770:10: p2 declared but not used
./example_test.go:720:6: dbi declared but not used
./example_test.go:709:6: dbi declared but not used
./example_test.go:696:6: dbi declared but not used
./example_test.go:682:6: dbi declared but not used
./example_test.go:668:6: dbi declared but not used
./example_test.go:341:6: dbi declared but not used
vet: typecheck failures
FAIL	github.com/bmatsuo/lmdb-go/lmdb [build failed]
  • reformat FALLTHRU statement in C code to match compiler expectations. Currently, we see this:
# github.com/bmatsuo/lmdb-go/lmdb
mdb.c: In function ‘mdb_cursor_put’:
mdb.c:6725:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (SIZELEFT(fp) < offset) {
         ^
mdb.c:6731:5: note: here
     case MDB_CURRENT:
     ^~~~

This fixes #126.

Variables should be masked so they could not be marked
as unusable by compiler.

Signed-off-by: Yerden Zhumabekov <[email protected]>
Signed-off-by: Yerden Zhumabekov <[email protected]>
Signed-off-by: Yerden Zhumabekov <[email protected]>
refer to https://github.com/LMDB/lmdb/
revision 45745fcd072f1d78eb399417513c7ce0c6663d57

Signed-off-by: Yerden Zhumabekov <[email protected]>
@yerden yerden closed this Jul 9, 2022
@yerden yerden deleted the test_fix branch July 9, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build warning on gcc 7.3.0
1 participant