Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.

Build Warnings - Mac OS X #33

Open
jsherer opened this issue Oct 1, 2014 · 5 comments
Open

Build Warnings - Mac OS X #33

jsherer opened this issue Oct 1, 2014 · 5 comments

Comments

@jsherer
Copy link

jsherer commented Oct 1, 2014

FYI, I'm getting these build warnings on Mac OS 10.9.4, go version 1.3.1:

github.com/szferi/gomdb/mdb.c:5862:9: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
github.com/szferi/gomdb/mdb.c:5888:9: note: uninitialized use occurs here
github.com/szferi/gomdb/mdb.c:5862:5: note: remove the 'if' if its condition is always true
github.com/szferi/gomdb/mdb.c:5721:10: note: initialize the variable 'rc' to silence this warning
github.com/szferi/gomdb/mdb.c:9260:46: warning: data argument not used by format string [-Wformat-extra-args]

The warnings don't seem serious, but is this something we should consider fixing in mdb.c and pushing upstream to MDB's maintainer?

@genedna
Copy link

genedna commented Oct 2, 2014

I got same warnings on Mac OS 10.10, go version 1.3.2 & 1.3.3

# github.com/szferi/gomdb
../../szferi/gomdb/mdb.c:5862:9: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
../../szferi/gomdb/mdb.c:5888:9: note: uninitialized use occurs here
../../szferi/gomdb/mdb.c:5862:5: note: remove the 'if' if its condition is always true
../../szferi/gomdb/mdb.c:5721:10: note: initialize the variable 'rc' to silence this warning
../../szferi/gomdb/mdb.c:9260:46: warning: data argument not used by format string [-Wformat-extra-args]
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'

@szferi
Copy link
Owner

szferi commented Oct 4, 2014

Thank you for the info. Indeed it is the problem of the upstream lmdb. I will see what can I do but in the meantime if you can issue ticket there it helps the process.

@opsec
Copy link

opsec commented Oct 14, 2015

same problem on freebsd.

@bmatsuo
Copy link
Contributor

bmatsuo commented Oct 14, 2015

@opsec it seems like the lines in question have been modified in more recent versions of LMDB (current is 0.9.16, gomdb is at 0.9.14). I'm not positive but it looks like there is at least a good chance that these warnings have been addressed.

You could try a go get on my lmdb bindings which use 0.9.16 to see if warnings are still printed by the C compiler.

go get github.com/bmatsuo/lmdb-go/lmdb

My package is not actually a fork. It has a different interface. But it will let you quickly see if the compiler warnings have been addressed. I'm sure there are some forks out there that have updated to a newer version of the library but I do not know which they are.

@bmatsuo
Copy link
Contributor

bmatsuo commented Oct 19, 2015

I got a chance to test compiling my package (LMDB 0.9.16) on OS X 10.9.5 and most of the warnings are gone. Only the last one remains (and the accompanying note).

# github.com/bmatsuo/lmdb-go/lmdb
src/github.com/bmatsuo/lmdb-go/lmdb/mdb.c:9466:46: warning: data argument not used by format string [-Wformat-extra-args]
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants