diff --git a/src/config/File.cxx b/src/config/File.cxx index b552e6c2a..24b96f1c5 100644 --- a/src/config/File.cxx +++ b/src/config/File.cxx @@ -116,6 +116,11 @@ ReadConfigBlock(ConfigData &config_data, BufferedReader &reader, const unsigned i = unsigned(o); const ConfigTemplate &option = config_block_templates[i]; + if (option.deprecated) + FormatWarning(config_file_domain, + "config parameter \"%s\" on line %u is deprecated", + name, reader.GetLineNumber()); + if (!option.repeatable) if (const auto *block = config_data.GetBlock(o)) throw FormatRuntimeError("config parameter \"%s\" is first defined " @@ -143,6 +148,11 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader, const unsigned i = unsigned(o); const ConfigTemplate &option = config_param_templates[i]; + if (option.deprecated) + FormatWarning(config_file_domain, + "config parameter \"%s\" on line %u is deprecated", + name, reader.GetLineNumber()); + if (!option.repeatable) if (const auto *param = config_data.GetParam(o)) throw FormatRuntimeError("config parameter \"%s\" is first defined " diff --git a/src/config/Templates.hxx b/src/config/Templates.hxx index d87ba02be..ac3ebcc75 100644 --- a/src/config/Templates.hxx +++ b/src/config/Templates.hxx @@ -24,7 +24,6 @@ struct ConfigTemplate { const char *const name; const bool repeatable; - // TODO: print warning when a deprecated option is used const bool deprecated; constexpr ConfigTemplate(const char *_name,