diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2017-06-18 23:22:02 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2017-06-18 23:46:57 -0400 |
commit | 9abef6f25aadfd04309cb2219068097f93dc961d (patch) | |
tree | f88c7f183f201813f363d5d68c1a4a76781ca7ef /src/mongo/db/mongod_options.cpp | |
parent | a5f0a84c79b6ce41fef33da920c62be0ecc8f07b (diff) | |
download | mongo-9abef6f25aadfd04309cb2219068097f93dc961d.tar.gz |
SERVER-27244 Status usage compile-time facilities.
There are numerous places in the codebase where `mongo::Status` or
`mongo::StatusWith< T >` objects are returned and never checked.
Many of these are innocuous, but many of them are potentially
severe bugs. This change introduces facilities to permit
compile-time warning of unchecked `Status` and `StatusWith` usage
on clang compilers. It introduces an `ignore` function which is
useful to state that a specific "ignored status" case was
intentional. It not presently an error, in clang builds, to
forget to check a `Status` -- this will come in a later commit.
This also introduces a `transitional_ignore` function, which allows
for easy continual auditing of the codebase for current "whitelisted"
unchecked-status instances. All present "ignored status" cases
have been marked `transitional_ignore`.
Diffstat (limited to 'src/mongo/db/mongod_options.cpp')
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index f679f71b303..0f00b00d615 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -512,18 +512,18 @@ Status addMongodOptions(moe::OptionSection* options) { .setSources(moe::SourceYAMLConfig); - options->addSection(general_options); + options->addSection(general_options).transitional_ignore(); #if defined(_WIN32) - options->addSection(windows_scm_options); + options->addSection(windows_scm_options).transitional_ignore(); #endif - options->addSection(replication_options); - options->addSection(ms_options); - options->addSection(rs_options); - options->addSection(sharding_options); + options->addSection(replication_options).transitional_ignore(); + options->addSection(ms_options).transitional_ignore(); + options->addSection(rs_options).transitional_ignore(); + options->addSection(sharding_options).transitional_ignore(); #ifdef MONGO_CONFIG_SSL - options->addSection(ssl_options); + options->addSection(ssl_options).transitional_ignore(); #endif - options->addSection(storage_options); + options->addSection(storage_options).transitional_ignore(); // The following are legacy options that are disallowed in the JSON config file |