>On Tue, Jul 29, 2008 at 05:44:34PM +0100, Nick Todd - Sun Microsystems wrote: > >> >The majority of these changes are casting a pointer into a void pointer >> >for the benefit of %p. Why does lint warn about this? >> > >> >I understand that you probably don't have any choice in the matter, but >> >boy, this uglifies code. >> >> The C standard says that if you're passing %p as part of a variable >> argument string then the matching type must be (void *). > >I wonder what the rationale is. Function descriptors? Can't think of >anything else that actually occurs in practice (and definitely nothing >that runs Solaris ;)
I once used a system in which all pointers except for char * and void * were shift one bit right. E.g., a char * for 0x22222222 was represented as a 0x11111111 when casted to a short. On that system (AOS/VS on a Data General Eclipse) printed 11111111 when you didn't add (void *). With (void *) it would print 22222222. Casper
