Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!oliveb!felix!dhw68k!arcturus!evil From: evil@arcturus.UUCP (Wade Guthrie) Newsgroups: comp.lang.c Subject: Re: Do you have to cast void pointers when dereferencing them? Keywords: (With ANSI C) Message-ID: <3078@arcturus> Date: 19 Dec 88 16:50:41 GMT References: <2414@ssc-vax.UUCP> <15012@mimsy.UUCP> <3050@arcturus> <749@auspex.UUCP> Organization: Rockwell International, Anaheim, CA Lines: 30 In article <749@auspex.UUCP>, guy@auspex.UUCP (Guy Harris) writes: > Originally (well not ORIGINALLY. . .) I said: > >code must know the type of the lvalue to put the rvalue into the proper > >representation. Is this not true? > . . .Why is this any different from > int foo; float bar; bar = foo; > which also causes an implicit conversion from "int" to "float"? The statement I made was regarding implicit conversion between pointer types. Well, as far as K&R goes, no implicit pointer type conversion is made (they do describe how ints can be converted to float (actually double, but I digress)). This, I believe, is the root of some of the discussion lately that the following is non-portable: #define NULL (char *)0 . . . int *foo; foo = NULL; (note that different pointer types are on either side of the '='). Wade Guthrie Rockwell International Anaheim, CA (Rockwell doesn't necessarily believe / stand by what I'm saying; how could they when *I* don't even know what I'm talking about???)