Skip to content

Commit fdd7b1d

Browse files
authored
refs #10736 - cli/main.cpp: removed conditional (NDEBUG) exception handling (#8122)
1 parent bb8a593 commit fdd7b1d

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ cli/executor.o: cli/executor.cpp cli/executor.h lib/addoninfo.h lib/checkers.h l
697697
cli/filelister.o: cli/filelister.cpp cli/filelister.h lib/config.h lib/filesettings.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/standards.h lib/utils.h
698698
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/filelister.cpp
699699

700-
cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/config.h lib/errortypes.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h
700+
cli/main.o: cli/main.cpp cli/cppcheckexecutor.h lib/config.h lib/filesettings.h lib/mathlib.h lib/path.h lib/platform.h lib/standards.h
701701
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/main.cpp
702702

703703
cli/processexecutor.o: cli/processexecutor.cpp cli/executor.h cli/processexecutor.h lib/addoninfo.h lib/check.h lib/checkers.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h

cli/main.cpp

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,8 @@
5656
* When errors are found, they are reported back to the CppCheckExecutor through the ErrorLogger interface.
5757
*/
5858

59-
6059
#include "cppcheckexecutor.h"
6160

62-
#ifdef NDEBUG
63-
#include "errortypes.h"
64-
65-
#include <cstdlib>
66-
#include <exception>
67-
#include <iostream>
68-
#endif
69-
7061
/**
7162
* Main function of cppcheck
7263
*
@@ -77,21 +68,5 @@
7768
int main(int argc, char* argv[])
7869
{
7970
CppCheckExecutor exec;
80-
81-
// *INDENT-OFF*
82-
#ifdef NDEBUG
83-
try {
84-
#endif
85-
return exec.check(argc, argv);
86-
#ifdef NDEBUG
87-
} catch (const InternalError& e) {
88-
std::cout << e.errorMessage << std::endl;
89-
} catch (const std::exception& error) {
90-
std::cout << error.what() << std::endl;
91-
} catch (...) {
92-
std::cout << "Unknown exception" << std::endl;
93-
}
94-
return EXIT_FAILURE;
95-
#endif
96-
// *INDENT-ON*
71+
return exec.check(argc, argv);
9772
}

0 commit comments

Comments
 (0)