lmdb-go icon indicating copy to clipboard operation
lmdb-go copied to clipboard

build warning on gcc 7.3.0

Open yerden opened this issue 6 years ago • 4 comments

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.

yerden avatar Nov 23 '18 18:11 yerden

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

kevburnsjr avatar Feb 06 '20 17:02 kevburnsjr

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. :)

yerden avatar Feb 22 '20 07:02 yerden

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

whitehse avatar Mar 04 '20 16:03 whitehse

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: ^~~~

elliotmtx avatar Nov 09 '20 14:11 elliotmtx