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 687755 - eog-metadata-reader-png.c does lots of void pointer arithmetic
eog-metadata-reader-png.c does lots of void pointer arithmetic
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: GNOME3.8
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-06 13:37 UTC by Allison Karlitskaya (desrt)
Modified: 2012-11-06 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Allison Karlitskaya (desrt) 2012-11-06 13:37:17 UTC
(ptr + 1) is defined to be equal to sizeof (*ptr) bytes in memory past 'ptr'.

sizeof (void) is not defined, so it's illegal to do pointer arithmetic on void pointers.

eog-metadata-reader-png.c is doing an awful lot of that anyway, and it's causing problems with -Werror=pointer-arith, which seems to be enabled by default when I jhbuild.

Probably the correct thing to do is cast to (char *) in these cases since that's what void pointer arithmetic is usually taken to mean, even though it's technically undefined...
Comment 1 Felix Riemann 2012-11-06 17:35:05 UTC
Hmm, if it hits the PNG reader it likely hits the JPG reader as well.
Comment 2 Felix Riemann 2012-11-06 18:19:22 UTC
Okay, not many changes necessary due to some preprocessor magic. :)

Still quite a lot of warnings due to exempi and libexif.

commit 84c746b2b23e8a0b80ee9e7f18a4414707cc8002
Author: Felix Riemann <>
Date:   Tue Nov 6 19:08:45 2012 +0100

    Fix build breakage due to void pointer arithmetic
    
    With recent gnome-common the build fails due to the arithmetics
    using void pointers. Use the correct pointers to fix that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687755
---
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.