On OS X I keep getting the following warning:
The warning is on the third byte shift: /usr/local/include/ libbson-1.0/bson-endian.h:165: 38: Implicit conversion loses integer precision: 'unsigned long' to 'uint32_t' (aka 'unsigned int')
Is that just an OS X thing or does that happen on other OSes?
static BSON_INLINE uint32_t__bson_uint32_swap_ slow (uint32_t v) /* IN */
{
return ((v & 0x000000FFUL) << 24) |
((v & 0x0000FF00UL) << 8) |
((v & 0x00FF0000UL) >> 8) |
((v & 0xFF000000UL) >> 24);
}
That's mostly a spurious warning we're getting because we and a 32 bit value with a 64 bit value (v is 32 bit and UL declares an unsigned long, which is 64 bit on OS X). We don't actually create 64 bit literals anywhere in that expression, so we're not actually losing precision, but it does kick up those warnings.
{
return ((v & 0x000000FFUL) << 24) |
((v & 0x0000FF00UL) << 8) |
((v & 0x00FF0000UL) >> 8) |
((v & 0xFF000000UL) >> 24);
}
That's mostly a spurious warning we're getting because we and a 32 bit value with a 64 bit value (v is 32 bit and UL declares an unsigned long, which is 64 bit on OS X). We don't actually create 64 bit literals anywhere in that expression, so we're not actually losing precision, but it does kick up those warnings.
I took a patch for this a couple of weeks ago and it's fixed in libbson 1.02, which was released October 8th. So you can either ignore that error or upgrade to 1.0.2 to quiet it.
Ok, cool. I just downloaded the full mongo-c-driver 1.0.2 and get the following compilation error: I just did a ./configure and then a make as the docs said.
CC src/mongoc/libmongoc_1_0_la- mongoc-sasl.lo
CCLD libmongoc-1.0.la
clang: warning: argument unused during compilation: '-pthread'
Undefined symbols for architecture x86_64:
"_sasl_client_done", referenced from:
__mongoc_sasl_destroy in libmongoc_1_0_la-mongoc-sasl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libmongoc-1.0.la] Error 1
make: *** [all-recursive] Error 1
Well I just configured with a: --enable-sasl=no option to at least get it to compile. This may be a OS X Yosemite issue since I did not have this error before. It looks like the 10.10 SDK and the 10.9 SDK with sasl.h is different, and both are installed w/ the latest XCode.
CCLD libmongoc-1.0.la
clang: warning: argument unused during compilation: '-pthread'
Undefined symbols for architecture x86_64:
"_sasl_client_done", referenced from:
__mongoc_sasl_destroy in libmongoc_1_0_la-mongoc-sasl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libmongoc-1.0.la] Error 1
make: *** [all-recursive] Error 1
Well I just configured with a: --enable-sasl=no option to at least get it to compile. This may be a OS X Yosemite issue since I did not have this error before. It looks like the 10.10 SDK and the 10.9 SDK with sasl.h is different, and both are installed w/ the latest XCode.
The changes you referred to in bson-endian.h are not included in the tarball 1.0.2 installer though, btw.
Hey John, I also noticed the Yosemite issue yesterday and filed a ticket:
We will look into why the changes aren't in bson-endian.h in the 1.0.2 tarball.
댓글 없음:
댓글 쓰기