[freetds] cast to void?
Daniel Corbe
daniel.junkmail at gmail.com
Mon Dec 3 19:29:52 EST 2007
Most likely to squash a warning on some random crappy compiler. Believe it
or not not all compilers follow the standard religiously.
On Dec 3, 2007 7:19 PM, James K. Lowden <jklowden at freetds.org> wrote:
> Hi Freddy!
>
> memset((void*)pnullrep->bindval, ' ', bindlen);
>
> Why the cast? The first argument to memset is a void*. There's no need to
> cast it. In C, any data pointer can be assigned to a void pointer, and a
> void pointer can be assigned to any data pointer. That's why void* was
> invented!
>
> http://www.lysator.liu.se/c/rat/c2.html
> http://www.opengroup.org/onlinepubs/000095399/functions/memset.html
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
More information about the FreeTDS
mailing list