Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upssl_manager.cpp: fix build with gcc 7 and -fpermissive #1296
Conversation
Change prototype of DERToken::parse function from parse(ConstDataRange cdr, size_t* outLength); to parse(ConstDataRange cdr, uint64_t* outLength); Otherwise, we got the following error: src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWith<mongo::{anonymous}::DERToken> mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)': src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive] if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) || Signed-off-by: Fabrice Fontaine <[email protected]>
@ffontaine - Thanks for the pull request. The master branch of MongoDB recently switched to requiring GCC 8, and we do not see this error in our builds that use OpenSSL. Could you try your build again with the most recent HEAD of master, and see if you still see this issue? If so, I'd like to understand what is different about your build environment and ours. Could you also provide information on your build OS, OpenSSL version, SCons command line, etc. |
I'm building latest stable version (4.0.6) with buildroot on ARM cortex a9 and openssl in version 1.1.1a. On this target architecture (and any other 32-bits architectures), size_t is defined as unsigned int. |
I get it now: this is 32-bit only. Thank you for clarifying that. We don't happen to do any 32-bit SSL enabled builds in our CI system, so we wouldn't have noticed. We can take a look at making this change. I am a little curious about what storage engine(s) you are configuring in 32-bit mode though, as WiredTiger doesn't work there. In order to help expedite getting this merged could you please:
Thanks! |
ffontaine commentedFeb 10, 2019
Change prototype of DERToken::parse function from
parse(ConstDataRange cdr, size_t* outLength);
to parse(ConstDataRange cdr, uint64_t* outLength);
Otherwise, we got the following error:
src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWithmongo::{anonymous}::DERToken mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)':
src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) ||
Signed-off-by: Fabrice Fontaine [email protected]