On Sun, Aug 28, 2005 at 11:03:31PM +0200, Thomas Schwinge wrote: > > > + > > > +void (*__malloc_initialize_hook) (void) = (void *) init_hook; > > > > Do you really need the void * cast? > > The cast avoids the following warning: > #v+ > [...] > ../../hurd-0/mach-defpager/../serverboot/kalloc.c:43: warning: initialization > from incompatible pointer type > [...] > #v-
I think the proposed code should give a compiler error (which doesn't mean that it does, of course). Function pointers and data pointers are really different types, and cannot be mixed. They need not even be the same size. If you really want to cast, then cast to the correct type, in this case a function pointer (with matching arguments and return type). However, it is usually better to make sure the prototype of the function is correct, so you don't need the cast. I didn't check if that is possible at all in this case. Thanks, Bas -- I encourage people to send encrypted e-mail (see http://www.gnupg.org). If you have problems reading my e-mail, use a better reader. Please send the central message of e-mails as plain text in the message body, not as HTML and definitely not as MS Word. Please do not use the MS Word format for attachments either. For more information, see http://129.125.47.90/e-mail.html
signature.asc
Description: Digital signature
_______________________________________________ Bug-hurd mailing list Bug-hurd@gnu.org http://lists.gnu.org/mailman/listinfo/bug-hurd