Minor update: Updated the readme and checkproj files.

This commit is contained in:
Daniel Marjamäki 2007-07-26 06:16:29 +00:00
parent e816bff240
commit d3f30c0a6e
2 changed files with 39 additions and 12 deletions

13
checkproj.bat Normal file
View File

@ -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
)

View File

@ -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)