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 590269 - Checking soup method causes compiler warning with gcc 4.4
Checking soup method causes compiler warning with gcc 4.4
Status: RESOLVED DUPLICATE of bug 588771
Product: libsoup
Classification: Core
Component: Misc
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-07-30 13:57 UTC by Joshua Lock
Modified: 2009-07-30 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Joshua Lock 2009-07-30 13:57:51 UTC
When building gupnp against libsoup 2.27.5 on a Fedora 11 box with gcc 4.4 I get a compiler warning when gupnp checks the soup method i.e. 
msg->method != SOUP_METHOD_GET

This seems like it could be a problem as this is, afaict, the standard way of checking the soupe method.

Output below:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/home/josh/Moblin/moblin2/install/include/gssdp-1.0 -I/home/josh/Moblin/moblin2/install/include/libsoup-2.4 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/uuid -I.. -g -O2 -g -Wall -Werror -MT gupnp-context.lo -MD -MP -MF .deps/gupnp-context.Tpo -c gupnp-context.c  -fPIC -DPIC -o .libs/gupnp-context.o
cc1: warnings being treated as errors
gupnp-context.c: In function ‘host_path_handler’:
/usr/include/glib-2.0/glib/gthread.h:344: error: dereferencing pointer ‘_SOUP_METHOD_GET.51’ does break strict-aliasing rules
gupnp-context.c:780: note: initialized from here
/usr/include/glib-2.0/glib/gthread.h:344: error: dereferencing pointer ‘_SOUP_METHOD_HEAD.53’ does break strict-aliasing rules
gupnp-context.c:781: note: initialized from here
Comment 1 Ross Burton 2009-07-30 14:07:40 UTC
The relevant code is this:

        if (msg->method != SOUP_METHOD_GET &&
            msg->method != SOUP_METHOD_HEAD) {

Annoyingly attempting to make a minimal test case which demonstrated this problem failed.  Dan, hopefully you have some insight.  Our current theory is that this is a gcc-4.4 extra-pedantic thing.
Comment 2 Dan Winship 2009-07-30 14:10:17 UTC
just referring to a SOUP_METHOD_* define will trigger the warning, assuming you're building with -O2; I didn't notice it when I made the change to how they're defined because I always build with -g and no -O for ease of debugging.


*** This bug has been marked as a duplicate of 588771 ***