Re: Question about void pointers



vippstar@xxxxxxxxx writes:

You have two options, do it portably, or do it with an extension, with
absolutely no loss in efficiency or size, and you advice to choose the
extension.

I admit that, occasionally, I've used pointer arithmetic on void
* in cases where GCC is the only compiler that matters. (Code
inside the Linux kernel is one example.) The nice thing about
doing it that way is that it avoids having to insert additional
casts, which are ugly.

I wouldn't do it in a place where portability matters.
--
"To get the best out of this book, I strongly recommend that you read it."
--Richard Heathfield
.



Relevant Pages

  • Re: Question about void pointers
    ... You can have the "worst advice of the month" clc award. ... You have two options, do it portably, or do it with an extension, with ... perhaps the OP doesn't need portability (or at least not this ... void * seems more natural for this kind ...
    (comp.lang.c)
  • Re: Question about void pointers
    ... But if your compiler can do it with the void ... You can have the "worst advice of the month" clc award. ... You have two options, do it portably, or do it with an extension, with ...
    (comp.lang.c)
  • Re: start service with parameters on restart
    ... i must admit that after i discovered the "some applications only read the ... for the advice they provide. ... get it right the first time but he usually perseveres until he finds a ... then you follow it immediately with a lecture ...
    (microsoft.public.windows.server.general)
  • Re: Hibernating early arent we
    ... I'm up to my neck in decorating our new extension, the completion of which was promised for September,but as yet remains unfinished, Builders!! ... I must admit to a little disappointment with the response to my last posting so much so that I've taken someones advice and resubscribed to the S.E. mag to see if they can help. ...
    (uk.rec.engines.stationary)
  • Re: Is Chris Hills a troll?
    ... program is UB (and because there were no explicit header files). ... You could point out that whilst many compilers will take void main the ... The posters are offering their time and help of their own ... If you think the advice is poor, ...
    (comp.lang.c)