hiding lint's ravings (was Re: FAQ - malloc array - clarify)
Mark Moraes
moraes at cs.toronto.edu
Wed Sep 12 13:19:40 AEST 1990
ik at laic.UUCP (Ik Su Yoo) writes:
>#ifndef lint
>#define MALLOC(size) (malloc(size))
>#else
>#define MALLOC(size) (0)
>#endif
With the unfortunate side effect that you now don't let lint check the
argument to malloc/calloc/realloc/free. I much prefer the lint noise
to this -- the lint noise doesn't hurt, but a missing argument to
realloc may.
If you create functions to allocate the different types you need, and
stick them in a file, you get the lint noise in a single well-known
place (or a few well-known places) and can easily ignore it.
Mark.
More information about the Comp.lang.c
mailing list