From d3f30c0a6e5401a7b5f542954b74da2ff1dab483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 26 Jul 2007 06:16:29 +0000 Subject: [PATCH] Minor update: Updated the readme and checkproj files. --- checkproj.bat | 13 +++++++++++++ readme.txt | 38 ++++++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 checkproj.bat diff --git a/checkproj.bat b/checkproj.bat new file mode 100644 index 000000000..728c3136f --- /dev/null +++ b/checkproj.bat @@ -0,0 +1,13 @@ + +REM Sample DOS shellscript +REM cppcheck all *.cpp files in the subdirectory 'proj' + +@ECHO OFF + +date /t > report.txt +time /t >> report.txt + +FOR %%s IN (proj\*.cpp) DO ( + cppcheck proj\%%s +) + diff --git a/readme.txt b/readme.txt index 129f6dfa2..af54ca1d5 100644 --- a/readme.txt +++ b/readme.txt @@ -1,43 +1,57 @@ + + ========= C++ check ========= + Compiling Any C++ compiler should work. There are no dependencies. - Linux: - g++ -o cppcheck main.cpp + The Makefile works under Linux. + To make it work under Windows, change "g++" to "gxx". - Windows: - gxx -o cppcheck main.cpp + I haven't been able to test it on other platforms. Usage The syntax is: - cppcheck [-w] filename.cpp + cppcheck [--all] [--style] filename.cpp The error messages will be printed to stderr. - If you specify '-w', additional warning - messages will be printed. Recommendations Create a shell script that checks all files. + See "checkproj.bat" for an example of how it can be done under Windows. + + When the "--all" flag is given you may get a lot of error messages. + + To dump the messages to a textfile you can use a command like this: + cppcheck --all filename.cpp 2> messages.txt + + If you want to filter the messages you could use: + * grep to filter out specific types of messages + * diff to compare old messages with new messages. There are even GUIs for + this. + + + +Suggestions + + I'd like to get suggestions about new checks. Author - Daniel Marjamäki - A 29 year old from sweden who works in - Stockholm as a programmer (developing - a RAD tool for control systems that - control hydraulics). + Daniel Marjamäki (danielm77@spray.se) +