bmatsuo / lmdb-go

Bindings for the LMDB C library
BSD 3-Clause "New" or "Revised" License
158 stars 59 forks source link

build warning on gcc 7.3.0 #126

Open yerden opened 5 years ago

yerden commented 5 years ago

Hi, I have ubuntu bionic, gcc 7.3.0-16ubuntu3. I have implicit fallthrough warning:

$  go get github.com/bmatsuo/lmdb-go/lmdb
# 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:6730:5: note: here
     case MDB_CURRENT:
     ^~~~

That could be worked around with some gcc-specific attributes but I think it's worth disabling this warning altogether.

kevburnsjr commented 4 years ago

This was fixed upstream. Probably better to copy in the updated lib rather than altering the source.

yerden commented 4 years ago

This was fixed upstream. Probably better to copy in the updated lib rather than altering the source.

No luck merging this anyway for quite a long time now. Let's hope the maintainer will return and make the choice. :)

whitehse commented 4 years ago

I also ran into this issue on Debian. I did the following to get a successful build:

cd ~/go/src/github.com/
go get github.com/kevburnsjr/lmdb-go/lmdb
rm -rf bmatsuo/
mv kevburnsjr/ bmatsuo

@kevburnsjr I appreciate your patches

elliotmtx commented 3 years ago

Hi I am facing this issue now, same issue is not observed any of my colleagues, not sure why. Any one can please help me.

DEBUG: Executing shell function do_compile_ptest_base

github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb

mdb.c: In function 'mdb_cursor_put': mdb.c:6535:9: warning: this statement may fall through [-Wimplicit-fallthrough=] if (SIZELEFT(fp) < offset) { ^ mdb.c:6540:5: note: here case MDB_CURRENT: ^~~~