summaryrefslogtreecommitdiff
path: root/buildscripts/idl
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/idl')
-rw-r--r--buildscripts/idl/idl/generator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
index 93ec9386565..ecfaacce090 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -1946,7 +1946,10 @@ class _CppSourceFileWriter(_CppFileWriterBase):
with self._block('MONGO_STARTUP_OPTIONS_STORE(%s)(InitializerContext*) {' %
(blockname), '}'):
self._writer.write_line('namespace moe = ::mongo::optionenvironment;')
- self._writer.write_line('const auto& params = moe::startupOptionsParsed;')
+ # If all options are guarded by non-passing #ifdefs, then params will be unused.
+ self._writer.write_line(
+ 'MONGO_COMPILER_VARIABLE_UNUSED const auto& params = moe::startupOptionsParsed;'
+ )
self.write_empty_line()
for opt in spec.configs: