diff --git a/cxx-sensors/src/main/java/org/sonar/cxx/sensors/compiler/gcc/CxxCompilerGccRuleRepository.java b/cxx-sensors/src/main/java/org/sonar/cxx/sensors/compiler/gcc/CxxCompilerGccRuleRepository.java index 4fa5251b2..9ab2de015 100644 --- a/cxx-sensors/src/main/java/org/sonar/cxx/sensors/compiler/gcc/CxxCompilerGccRuleRepository.java +++ b/cxx-sensors/src/main/java/org/sonar/cxx/sensors/compiler/gcc/CxxCompilerGccRuleRepository.java @@ -40,4 +40,24 @@ public CxxCompilerGccRuleRepository(ServerFileSystem fileSystem, RulesDefinition super(fileSystem, xmlRuleLoader, LANGUAGE, KEY, NAME, FILE); } + @Override + public void prepareRule(NewRule rule) { + switch (rule.key()) { + case "-Wc++11-compat": + rule.addDeprecatedRuleKey(KEY, "-Wc++0x-compat"); + break; + case "-Wc++17-compat": + rule.addDeprecatedRuleKey(KEY, "-Wc++1z-compat"); + break; + case "-Wc11-c23-compat": + rule.addDeprecatedRuleKey(KEY, "-Wc11-c2x-compat"); + break; + case "-Wsuggest-attribute=format": + rule.addDeprecatedRuleKey(KEY, "-Wmissing-format-attribute"); + break; + case "-Wsuggest-attribute=noreturn": + rule.addDeprecatedRuleKey(KEY, "-Wmissing-noreturn"); + break; + } + } }