Skip to content

Commit

Permalink
No meaningful forceIncludes error message
Browse files Browse the repository at this point in the history
fix for SonarOpenCommunity#225:
* old: 15:55:16.367 WARN  - [:1]: cannot find the sources for '#include'
* new: 15:55:16.367 WARN  - [sonar.cxx.forceIncludes:1]: cannot find the sources for 'VS10Macros.h'
  • Loading branch information
guwirth authored and Bertk committed Sep 13, 2014
1 parent 579509f commit 8e3ab7b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public CxxPreprocessor(SquidAstVisitorContext<Grammar> context,
for (String include : conf.getForceIncludeFiles()) {
LOG.debug("parsing force include: '{}'", include);
if (!include.equals("")) {
parseIncludeLine("#include \"" + include + "\"");
parseIncludeLine("#include \"" + include + "\"", "sonar.cxx.forceIncludes");
}
}
} finally {
Expand Down Expand Up @@ -434,9 +434,9 @@ PreprocessorAction handleDefineLine(AstNode ast, Token token, String filename) {
return new PreprocessorAction(1, Lists.newArrayList(Trivia.createSkippedText(token)), new ArrayList<Token>());
}

private void parseIncludeLine(String includeLine) {
private void parseIncludeLine(String includeLine, String filename) {
AstNode includeAst = pplineParser.parse(includeLine);
handleIncludeLine(includeAst, includeAst.getToken(), "");
handleIncludeLine(includeAst, includeAst.getFirstDescendant(CppGrammar.includeBodyQuoted).getToken(), filename);
}

PreprocessorAction handleIncludeLine(AstNode ast, Token token, String filename) {
Expand Down

0 comments on commit 8e3ab7b

Please sign in to comment.