Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Done
-
None
-
None
-
Fully Compatible
-
ALL
-
-
Platform 3 05/15/15
Description
When the entire function is wrapped in a WCE retry-loop GCC doesn't deduce that a return statement will be reached.
Error:
src/mongo/db/repl/minvalid.cpp: In function 'bool mongo::repl::getInitialSyncFlag()':
|
src/mongo/db/repl/minvalid.cpp:95:5: error: control reaches end of non-void function [-Werror=return-type]
|
}
|
^
|
src/mongo/db/repl/sync.cpp: In member function 'virtual bool mongo::repl::Sync::shouldRetry(mongo::OperationContext*, const mongo::BSONObj&)':
|
src/mongo/db/repl/sync.cpp:158:5: error: control reaches end of non-void function [-Werror=return-type]
|
}
|
^
|
Apparently this was happening with gcc 4.9 as well according to spencer.
Toolchain: gcc 5.1.0 obtained from ubuntu-toolchain-test ppa
g++-5 -v
|
gcc version 5.1.0 (Ubuntu 5.1.0-0ubuntu11~14.04.1)
|
Note that this only happens on debug builds.
Attachments
Issue Links
- related to
-
SERVER-18343 'control reaches end of non-void function' error in storeLocalLastVoteDocument (gcc)
-
- Closed
-