Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!oliveb!felix!arcturus!evil From: evil@arcturus.UUCP (Wade Guthrie) Newsgroups: comp.lang.c Subject: Re: Do you have to cast void pointers when dereferencing them? Summary: Implicit type conversions for pointers in ANSI C? Keywords: (With ANSI C) Message-ID: <3050@arcturus> Date: 16 Dec 88 21:48:32 GMT References: <2414@ssc-vax.UUCP> <15012@mimsy.UUCP> Organization: Rockwell International, Anaheim, CA Lines: 35 In article <15012@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > > struct junk J; > > void *p; > > p = &J; > > The assignment `p = &J' (uncast) is legal dpANS C. Correct me if I'm wrong (on this net was THAT an unnecessary statement :-)), but this seems to indicate that the dpANS performs implicit type conversions for pointers. (To clarify my, often, imprecice terminology: given the following: int foo; float bar, fubar; fubar = foo + bar; I call the cast of foo to a float (which is not done explicitly by the programmer) along with the possible cast of both of these to double (not necessarily in that order) an implicit type conversion) My assumption (about the dbANS) comes from the understanding that different pointers can have different representations (on some machines). To say that pointer_of_one_type = pointer_of_another_type is legal, the code must know the type of the lvalue to put the rvalue into the proper representation. Is this not true? 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???)