Re: pointer arithmetic on a pointer to void

"Craig A. Berry" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Oct 10, 2013, at 7:57 PM, James K. Lowden <[email protected]> wrote:

> Pointer arithmetic on void* is invalid for the perfectly good reason
> that the void type has no size.  

Indeed.

> The choice between redefining the pointer to char* or casting void* to
> char* is one of convenience.  If your one-liner makes the compiler
> happy, I'd say that's most convenient.  

Seems to to the trick and causes no new test failures here.

> Thanks for pointing it out.  I'm surprised it hasn't cropped up
> before. 

FWIW, clang and gcc can be made to complain about the same thing by adding -Werror-pointer-arith to CFLAGS.

________________________________________
Craig A. Berry
mailto:[email protected]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.