From: "Aaron Bannert" <[EMAIL PROTECTED]> Sent: Thursday, January 10, 2002 12:31 AM
> > - new_m->usable = new_m->base + sizeof(apr_size_t); > > + new_m->usable = (char *)new_m->base + sizeof(apr_size_t); > > What a weird compiler -- it complains about type agreement for addition > expressions, but not for LHS/RHS agreement on assignment expressions? > > (I suppose it minds adding anything to a void*, but doesn't mind assigning > a char* to a void*.) No... that's actually the proper definition. A void has no size, correct? So you cannot add the sizeof(* (void*foo)) + x. By rights, compilers who assume sizeof(* (void*)) == 1 are actually broken :) On the other side, void* can be assigned to any * type, while any * type can be assigned to a void*. This is really poor practice, but entirely legal according to spec. It's the reason void*'s are usually poor choices.
