[Tremor] void * handling

Segher Boessenkool segher at kernel.crashing.org
Sun Sep 25 09:33:15 PDT 2005


> I'm trying to compile using Visual C++.
> In codebook.c, line 670:
>     void *ptr=s->q_val+entry*s->q_pack;
>
> The above line results in the error:
> C2036: 'void *' : unknown size
>
> q_val is void* so the compiler probably doesn't know
> how much to increment the address.

Yes.

> I'm guessing that
> it is incremented in byte units, ie if q_val is 0x100,
> then q_val += 4 would be 0x104.

Yes.

This is a GCC extension; when using GCC, compile with
-Wpointer-arith or -pedantic to get warnings about cases
like this.


Segher



More information about the Tremor mailing list