Skip to Content.
Sympa Menu

freetds - Re: [freetds] pointer arithmetic on a pointer to void

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Craig A. Berry" <craigberry AT mac.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] pointer arithmetic on a pointer to void
  • Date: Fri, 11 Oct 2013 09:54:50 -0500


On Oct 10, 2013, at 7:57 PM, James K. Lowden <jklowden AT freetds.org> 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:craigberry AT mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser





Archive powered by MHonArc 2.6.24.

Top of Page