diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 55130f806..cd1cd279a 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -482,6 +482,9 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string } catch (const InternalError &e) { internalError(filename, e.errorMessage); exitcode=1; // e.g. reflect a syntax error + } catch (const simplecpp::Output &o) { + internalError(std::string(o.location.file() + ':' + MathLib::toString(o.location.line)), o.msg); + exitcode=1; // e.g. reflect an error during preprocessing } analyzerInformation.setFileInfo("CheckUnusedFunctions", checkUnusedFunctions.analyzerInfo());