After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 142819 - ppc64 fix for gstreamer
ppc64 fix for gstreamer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: documentation
git master
Other other
: Low minor
: 0.8.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-20 07:52 UTC by Callum McKenzie
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for pointer arithmetic when sizeof(int) != sizeof(void *) (475 bytes, patch)
2004-05-20 07:54 UTC, Callum McKenzie
none Details | Review

Description Callum McKenzie 2004-05-20 07:52:06 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.
Comment 1 Callum McKenzie 2004-05-20 07:54:01 UTC
Created attachment 27864 [details] [review]
Fix for pointer arithmetic when sizeof(int) != sizeof(void *)
Comment 2 David Schleef 2004-05-20 19:32:35 UTC
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.