Try running lint first (perhaps with the -a
, -c
, -h
, -p
and/or
other options). Many C compilers are really only half-
compilers, electing not to diagnose numerous source code
difficulties which would not actively preclude code generation.
malloc
?
The problem is that traditional versions of lint do not know,
and cannot be told, that malloc
"returns a pointer to space
suitably aligned for storage of any type of object." It is
possible to provide a pseudoimplementation of malloc
, using a
#define
inside of #ifdef lint
, which effectively shuts this
warning off, but a simpleminded #definition will also suppress
meaningful messages about truly incorrect invocations. It may
be easier simply to ignore the message, perhaps in an automated
way with grep -v
.
A product called FlexeLint is available (in "shrouded source form," for compilation on 'most any system) from
Gimpel Software
3207 Hogarth Lane
Collegeville, PA 19426 USA
(+1) 610 584 4261
gimpel@netaxs.com
The System V release 4 lint is ANSI-compatible, and is available separately (bundled with other C tools) from UNIX Support Labs, or from System V resellers.
Another ANSIcompatible lint (which can also perform higherlevel formal verification) is LCLint, available via anonymous ftp from larch.lcs.mit.edu://pub/Larch/lclint/.
In the absence of lint, many modern compilers attempt to diagnose almost as many problems as a good lint does.