Linting Malloc (Was: Re: Need help with pointer to array[][])
guy at gorodish.UUCP
guy at gorodish.UUCP
Sat Mar 14 11:31:33 AEST 1987
> char *malloc();
> struct condition_rec *cond;
>
>lint (Pyramid 98X, 3.1 DualOSx, BSD Universe):
> "warning: possible pointer alignment problem"
> ...
> hasn't. I there a way to get lint to pass this, make
> this "more" portable ...?
No, short of waiting for ANSI C, where there is a "void *" data type for
"generic" pointers, and "malloc" returns a pointer of that type. Presumably
pointers of this type could be converted to and from pointers of other
types, in implementations that support "void *", without this "lint"
warning. (Yes, there is still a possible alignment problem, but "lint"
should assume that somebody writing a routine that constructs a "void *"
value and returns it knows this already and has dealt with it.)
More information about the Comp.lang.c
mailing list