Re: pointer arithmetic on a pointer to void
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4cD-Rd7-gEo+8tQhJghO5LE6p6a2rtrYWmFhm5F-A736A@mail.gmail.com> |
2013/10/11 Craig A. Berry <[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. > Committed 2 patches, one to add the warning and the other to remove the problem Frediano