A few notes about Gimpel PC-lint
I had reasonable success using PC-lint under Cygwin 1.5.x with GCC 3.3.1. Here are some configuration files to make it work.
In directory "C:\lint":
// Gnu C/C++, -si4 -sp4,
// Standard lint options
co-cygwin.lnt
options.lnt -si4 -sp4
// emacs style
-"format=%(%f:%l:%c: %)%t %n: %m"
Starting from the file co-gnu3.lnt available on the Gimpel web site, the file must be modified to add most variables pre-defined by GCC (use gcc -E -dM -xc /dev/null). Then various oddities crop up such as disabling some MS reserved keywords, adding some GCC builtins, etc.
The option -cgnu imports the symbols declared in the std namespace in the global namespace. If not suitable, it needs to be commented out.
The following scheme works reasonably well. Put project specific options in the file my_project.lnt. Each ".cpp" produces a ".lob" ("lint object") (-u: unit checking, -zero: return zero as error code, -oo: produce a "lob" file). All ".lob" files can be process together to cross check the modules.
LINT = C:\\lint\\lint-nt -iC:\\lint std.lnt
LINTFLAGS = my_project.lnt
MODFLAGS = -u -zero -oo\($@\)
OBJECTS = xxx.lob
project: $(OBJECTS)
$(LINT) $(LINTFLAGS) $(OBJECTS)
xxx.lob: xxx.cpp
$(LINT) $(LINTFLAGS) $(MODFLAGS) xxx.cpp
Alternatively, the project can processed in one go by providing all source files to the command line. It scales surprisingly well.
This simple script provides a sorted list of messages.
Until Gimpel software fixes this, do be aware that PC-lint runs just fine on Linux as a regular console application and works just fine on G++ code.
LINT-NT.EXE only imports 57 symbols from KERNEL32.DLL, all of which are flawlessly implemented in Wine. There is no performance difference when running it this way.
Simply install Wine (http://www.winehq.com/), then just type:
$wine lint-nt.exe [parameters]
Or, if you add the appropriate line to "/proc/sys/fs/binfmt_misc/register", you can just type:
$lint-nt.exe [parameters]
For more details on running Win32 console apps under Linux with Wine, see:
http://www.winehq.com/site/docs/wine-user/cui-programs
See /usr/src/linux/Documentation/binfmt_misc.txt for more info about binfmt_misc.
$Id: PC-lint.html,v 1.6 2004/07/28 15:24:15 arnaud Exp $ | Valid XHTML and CSS
Maintained by Arnaud Desitter.