> > What solution do you prefer for the opaque types? I have used the simple:
> >  >> -    void *args[MAX_ARGS];
> >  >> +    intptr_t args[MAX_ARGS];
> >
> > A more portable and clean solution would be this:
> > -    void *args[MAX_ARGS];
> > +    union
> > +    {
> > +        void* ptr;
> > +        int i;
> > +    } args[MAX_ARGS];
> > If you prefer this, I can change the patch accordingly.
>
> I'm not sure why you get a warning here and I'm unable to run a build
> at the moment. A void * should be able to store some (unknown size)
> integer regardless of the platform.

Unfortunately there is no portable and reliable solution, other than avoiding 
storing arbitrary integers in pointer variables.

The details have been discussed on this list previously. The short version is 
that C89 guaranteed that "long" was at least as big as "void *". C99 removed 
this guarantee, and introduced intptr_t instead. To further complicate 
matters the only target (win64) that breaks the C89 guarantee doesn't support 
C99.

Paul


Reply via email to