GNOME Bugzilla – Bug 142819
ppc64 fix for gstreamer
Last modified: 2004-12-22 21:47:04 UTC
gstreamer does some pointer arithmetic which produces warnings whe compiled on a machine with different sizes for integers and pointers. The patch below is the simplest solution to the problem, it still truncates the pointer difference to 32-bits, but I assume that all that is really wanted is the traditional -1, 0, +1 comparison. This is a very low priority bug because the routine is never actually called by any of the functions it is supplied to as a parameter.
Created attachment 27864 [details] [review] Fix for pointer arithmetic when sizeof(int) != sizeof(void *)
The existing code is wrong for several reasons. 64-bit pointers only make the problem worse (possibly lots worse). It is well-known that MAXINT is greater than -MAXINT-1, but (MAXINT-(-MAXINT-1)) is -1, leading the caller to believe that MAXINT < -MAXINT-1. It's not entirely clear to me why this code wants to compare pointers. Seems rather dumb, and likely to be untested code. But I'll leave it. Thanks for noticing.