On Dec-18, Bruce Gray wrote: > # New Ticket Created by Bruce Gray > # Please include the string: [perl #19232] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19232 > > > > In parrot.h (revision 1.45 2002-08-07), macros were defined > to eliminate warnings during pointer conversions. See: > http://rt.perl.org/rt2/Ticket/Display.html?id=16019 > > The definition of the macros is controlled by the first line of this block: > #if (INTVAL_SIZE == PTR_SIZE) && (UINTVAL_SIZE == PTR_SIZE) > # define INTVAL2PTR(any,d) (any)(d) > # define UINTVAL2PTR(any,d) (any)(d) > #else > # if PTR_SIZE == LONG_SIZE > # define INTVAL2PTR(any,d) (any)(unsigned long)(d) > # define UINTVAL2PTR(any,d) (any)(unsigned long)(d) > # else > # define INTVAL2PTR(any,d) (any)(unsigned int)(d) > # define UINTVAL2PTR(any,d) (any)(unsigned int)(d) > # endif > #endif > #define PTR2INTVAL(p) INTVAL2PTR(INTVAL,p) > #define PTR2UINTVAL(p) UINTVAL2PTR(UINTVAL,p) > --snip-- > #define D2FPTR(x) UINTVAL2PTR(funcptr_t, PTR2UINTVAL(x)) > #define F2DPTR(x) UINTVAL2PTR(void *, PTR2UINTVAL((funcptr_t) x)) > > I cannot find a definition for UINTVAL_SIZE anywhere. Being > undefined, it evaluates to 0, and so the #if always fails. > This means that some systems have been getting the wrong > macro definitions. > > It would not be difficult to add Configure tests to define > UINTVAL_SIZE, but I think that it is not really needed. > Instead, the attached patch just changes the first line to: > #if PTR_SIZE == INTVAL_SIZE > ( Is there any platform for which sizeof(signed foo) <> > sizeof(unsigned foo)? Would the C spec even allow it? If so, > I will be glad to write the Configure tests. ) > > I feel confident that this simpler change is the Right > Thing, but it could uncover other bugs, and I have no > esoteric platforms to test it on. Here is a summary of the > patch's effect on different platforms:
That all sounded sensible to me. (And tests still pass here.) Thanks, applied.