diff --git a/cli/filelister.h b/cli/filelister.h index be4c60016..aa292b701 100644 --- a/cli/filelister.h +++ b/cli/filelister.h @@ -22,7 +22,7 @@ #include #include -/// @addtogroup Core +/// @addtogroup CLI /// @{ /** diff --git a/cli/filelister_unix.h b/cli/filelister_unix.h index f0b4e4c96..594580f0d 100644 --- a/cli/filelister_unix.h +++ b/cli/filelister_unix.h @@ -23,7 +23,7 @@ #include #include "filelister.h" -/// @addtogroup Core +/// @addtogroup CLI /// @{ diff --git a/cli/filelister_win32.cpp b/cli/filelister_win32.cpp index 041613331..776e0245a 100644 --- a/cli/filelister_win32.cpp +++ b/cli/filelister_win32.cpp @@ -88,7 +88,7 @@ static BOOL MyIsDirectory(std::string path) return (GetFileAttributes(path.c_str()) & FILE_ATTRIBUTE_DIRECTORY); #else // See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx -return PathIsDirectory(path.c_str()); + return PathIsDirectory(path.c_str()); #endif } diff --git a/cli/filelister_win32.h b/cli/filelister_win32.h index 4f89438bd..1095c79d7 100644 --- a/cli/filelister_win32.h +++ b/cli/filelister_win32.h @@ -23,7 +23,7 @@ #include #include "filelister.h" -/// @addtogroup Core +/// @addtogroup CLI /// @{ diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index 44238f5e9..1fb0af877 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -25,6 +25,9 @@ #include "settings.h" #include "errorlogger.h" +/// @addtogroup CLI +/// @{ + /** * This class will take a list of filenames and settings and check then * all files using threads. @@ -95,4 +98,6 @@ private: void operator=(const ThreadExecutor &); }; +/// @} + #endif // THREADEXECUTOR_H diff --git a/htdocs/.htaccess b/htdocs/.htaccess new file mode 100644 index 000000000..761a0f759 --- /dev/null +++ b/htdocs/.htaccess @@ -0,0 +1,2 @@ +#Redirect "devinfo.html" to the new place... +Redirect permanent /devinfo.html http://cppcheck.sourceforge.net/devinfo/ \ No newline at end of file diff --git a/htdocs/devinfo/index.php b/htdocs/devinfo/index.php new file mode 100644 index 000000000..b2be8bd6f --- /dev/null +++ b/htdocs/devinfo/index.php @@ -0,0 +1,43 @@ + + + + + Cppcheck - A tool for static C/C++ code analysis + + + + + + +
+
+

Doxygen

+ +

Other

+ +
+
+ + \ No newline at end of file diff --git a/htdocs/favicon.ico b/htdocs/favicon.ico new file mode 100644 index 000000000..60bb72001 Binary files /dev/null and b/htdocs/favicon.ico differ diff --git a/htdocs/index.php b/htdocs/index.php new file mode 100644 index 000000000..507a1d84b --- /dev/null +++ b/htdocs/index.php @@ -0,0 +1,70 @@ + + + + + Cppcheck - A tool for static C/C++ code analysis + + + + + + +
+
+

Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ +compilers and many other analysis tools, it don't detect syntax errors. Cppcheck +only detects the types of bugs that the compilers normally fail to detect. The +goal is no false positives.

+ +

Download

+

You can download the standalone tool from our +project page or try it +as plugin for your favorite IDE:

+ +

No plugin exists for Visual Studio, but it's possible to add +Cppcheck as an external tool.

+ +

Features

+
    +
  • Out of bounds checking
  • +
  • Check the code for each class
  • +
  • Checking exception safety
  • +
  • Memory leaks checking
  • +
  • Warn if obsolete functions are used
  • +
  • Check for invalid usage of STL
  • +
  • Check for uninitialized variables and unused functions
  • +
+ +

Support

+
    +
  • Use Trac to report + bugs and feature requests
  • +
  • Ask questions in the forum + or at the IRC channel #cppcheck
  • +
  • For more details look at the wiki
  • +
+
+
+ + \ No newline at end of file diff --git a/htdocs/site/css/all.css b/htdocs/site/css/all.css new file mode 100644 index 000000000..39f445e75 --- /dev/null +++ b/htdocs/site/css/all.css @@ -0,0 +1,71 @@ +body { + margin: 0; + padding: 0; + font-family: Calibri,Verdana,sans-serif; + background: #eee; +} + +/* Default link style */ +a:link { color:#036; text-decoration:underline; } +a:visited { color:#036; text-decoration:underline; } +a:focus { color:#369; text-decoration:none; } +a:hover { color:#369; text-decoration:none; } +a:active { color:#369; text-decoration:none; } + +/* Header */ +#header { + color: #69c; + background: #036; +} +#header h1 { + margin: 0; + padding: 0; +} +#header p { + margin: 0; + padding: 0; + font-size: larger; +} + +/* Tabs */ +#tabs { + color: #eee; + background: #369; + border-top: 1px solid black; + border-bottom: 1px solid black; +} +#tabs ul { + margin: 0; + padding: 0; + list-style-type: none; + font-size: larger; +} +#tabs ul li { + display: inline; + margin: 0; + padding: 0 .5em; + border-right: 1px solid black; +} +#tabs ul li:first-child { + padding-left: 0; +} +#tabs ul li:last-child { + border: none; +} +#tabs a:link { color:#eee; text-decoration:none; } +#tabs a:visited { color:#eee; text-decoration:none; } +#tabs a:focus { color:#fff; text-decoration:underline; } +#tabs a:hover { color:#fff; text-decoration:underline; } +#tabs a:active { color:#fff; text-decoration:underline; } + +/* Content */ +#content h2 { + margin-top: 0; +} + +/* Wrap */ +.wrap { + width: 50em; + margin: 0 auto; + padding: .5em; +} \ No newline at end of file diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 62719d6c6..db0a15105 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -151,13 +151,21 @@ unsigned int CppCheck::check() // was used. if (!_settings._force && checkCount > 11) { - if (_settings._errorsOnly == false) - { - const std::string fixedpath = Path::toNativeSeparators(fname); - _errorLogger.reportOut(std::string("Bailing out from checking ") + fixedpath + - ": Too many configurations. Recheck this file with --force if you want to check them all."); - } - + const std::string fixedpath = Path::toNativeSeparators(fname); + ErrorLogger::ErrorMessage::FileLocation location; + location.setfile(fixedpath); + std::list loclist; + loclist.push_back(location); + const std::string msg("Interrupted checking because of too many #ifdef configurations.\n" + "The checking of the file was interrupted because there were too many " + "#ifdef configurations. Checking of all #ifdef configurations can be forced " + "by --force command line option or from GUI preferences. However that may " + "increase the checking time."); + ErrorLogger::ErrorMessage errmsg(loclist, + Severity::information, + msg, + "toomanyconfigs"); + _errorLogger.reportErr(errmsg); break; } diff --git a/test/testother.cpp b/test/testother.cpp index a835ba30d..af08d80c4 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -89,6 +89,7 @@ private: TEST_CASE(testMisusedScopeObjectDoesNotPickLocalClassConstructors); TEST_CASE(testMisusedScopeObjectDoesNotPickUsedObject); TEST_CASE(testMisusedScopeObjectDoesNotPickPureC); + TEST_CASE(testMisusedScopeObjectDoesNotPickNestedClass); TEST_CASE(trac2071); TEST_CASE(trac2084); @@ -1358,6 +1359,27 @@ private: ASSERT_EQUALS("", errout.str()); } + void testMisusedScopeObjectDoesNotPickNestedClass() + { + const char code[] = "class ios_base {\n" + "public:\n" + " class Init {\n" + " public:\n" + " };\n" + "};\n" + "class foo {\n" + "public:\n" + " foo();\n" + " void Init(int);\n" + "};\n" + "foo::foo() {\n" + " Init(0);\n" + "}\n"; + + check(code, "test.cpp"); + TODO_ASSERT_EQUALS("", "[test.cpp:13]: (error) instance of \"Init\" object destroyed immediately\n", errout.str()); + } + void trac2084() { check("#include \n"