lint on malloc calls

Karl Heuer karl at haddock.ima.isc.com
Sat Sep 17 09:47:20 AEST 1988


In article <216 at iaoobelix.UUCP> woerz at iaoobelix.UUCP (Dieter Woerz) writes:
>>	extern void *malloc();
>
>This would only help, if you lint library, where malloc is defined,
>is changed too for malloc returning void *. But I think lint must be
>changed for this one too, as lint must know that a void * will always
>be aligned properly. I'm not sure, if the current lint's know this
>definition.

Since in fact a (void *) pointer is *not* always properly aligned, it's not
clear that this would be an appropriate change to make anyway.  Better would
be to have some other way to specify that malloc() is a special case.  I've
suggested doing it with a lintpragma:
	/* ALIGNED */
	extern void *malloc();	/* or "char *", if pre-ANSI */

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list