Alignment of malloced memory (was: lint on malloc calls)

Doug Gwyn gwyn at smoke.ARPA
Sun Sep 18 07:34:44 AEST 1988


In article <256 at itivax.UUCP> scs at itivax.UUCP (Steve C. Simmons) writes:
>All the discussion on the alignment of memory allocated by malloc
>is interesting, but only serves to point up that no matter what
>we try, the following lines of code are potentially non-portable:
>...
>char	*foo2 = malloc( foo2 ) ;
>...

"Incomprehensible" might be a better description.

What are you trying to say/ask?
malloc() most certainly can be used portably:

	/* (declarations omitted) */
	obj_ptr = (obj *)malloc( how_many * sizeof(obj) );



More information about the Comp.lang.c mailing list