cppcheck sept 18 redux

Henri Verbeet hverbeet at gmail.com
Tue Sep 22 09:01:53 CDT 2009


2009/9/22 Vitaliy Margolen <wine-devel at kievinfo.com>:
> It does dereference the pointer. Here is your simple test. Compile it and
> run it. See what happens.
>
> #include <stdio.h>
>
> typedef struct _s_test
> {
>    void *pointer;
> }  s_test;
>
> int main()
> {
>    s_test *s = NULL;
>    long diff = (const char*)s->pointer - (const char*)s;
>    printf("diff=%ld\n", diff);
>
>    return 0;
> }
>
> Vitaliy.
>

That's not really what the code does. Try changing "void *pointer" to
"char pointer[32]".



More information about the wine-devel mailing list