on********@yahoo.com wrote:
Hello,
gnu g++ offers something similar to lint/splint for statically
checking C programs with the following command:
g++ -W -Wall -Wshadow -Wwrite-strings -Wold-style-cast
-Woverloaded-virtual -pedantic -Os -fno-exceptions -c
does cl.exe in windows offer something similar?
cl -Wall -Zs
....would be a good place to start. You'll get more errors/warnings if you
remove -Zs (syntax check only) and let the compiler generate an OBJ file
since many warnings/errors are raised in the compiler back end. You'll
frequently get warnings from an optimized build that you don't get from a
debug build as well.
If you have Visual Studio team system, you can use
cl -analyze
to do extensive static checking on the code.
-cd