[net.lang.c] Lint,

craig@loki.ARPA (Craig Partridge) (07/29/85)

>Hopefully, pointers of the ANSI C type "void *" will be able to be assigned
>to any other pointer type without any complaints, including complaints about
>possible alignment problems.  This is, of course, a horribly large loophole,
>but there may be some small hope that people won't abuse it and will always
>write routines like "malloc" which return "void *" values to align the
>object pointed to so that it can, indeed, be used to point to anything.

    I'd prefer it if (void *) could be cast to anything without having
lint complain.  I don't want to be able to do something like

	void *vp;
	char *cp;

	    cp = vp;

without at least a strong warning from lint that I'm playing with fire.

Craig Partridge
craig@bbn-loki (ARPA)
craig%loki.arpa@csnet-relay (CSNET)
{decvax,ihnp4,wjh12}!bbncca!craig (USENET)

tp@ndm20 (08/09/85)

(void *) is note neccessarily the same as (char *).
If the machine is word addresseable, a (char *) might
not be aligned properly to point to an int, double, etc.
(void *) must be (char *) with the additional restriction
that the object pointed to be appropriately aligned for any
data type. 

Terry Poot
Nathan D. Maier Consulting Engineers
(214)739-4741
Usenet: ...!{allegra|ihnp4}!convex!smu!ndm20!tp
CSNET:  ndm20!tp@smu
ARPA:   ndm20!tp%smu@csnet-relay.ARPA