GNOME Bugzilla – Bug 590269
Checking soup method causes compiler warning with gcc 4.4
Last modified: 2009-07-30 14:10:17 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
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.
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 ***