Bug 23685 - [asyncns] Gabble fails to build with pedantic gcc
Summary: [asyncns] Gabble fails to build with pedantic gcc
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: unspecified
Hardware: Other All
: high major
Assignee: Guillaume Desmottes
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/ca...
Whiteboard:
Keywords: patch
: 22413 23567 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-03 06:26 UTC by Pierre-Luc Beaudoin
Modified: 2009-10-14 18:34 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Pierre-Luc Beaudoin 2009-09-03 06:26:09 UTC
Building telepathy-gabble on Ubuntu Karmic Koala:

I'll let Lennart know about this bug.

libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wdeclaration-after-statement -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT asyncns.lo -MD -MP -MF .deps/asyncns.Tpo -c asyncns.c  -fPIC -DPIC -o .libs/asyncns.o
cc1: warnings being treated as errors
asyncns.c: In function ‘process_worker’:
asyncns.c:526: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:526: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:529: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:530: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:531: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:532: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:534: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:535: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:535: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:538: error: dereferencing pointer ‘ai_req’ does break strict-aliasing rules
asyncns.c:521: note: initialized from here
asyncns.c:552: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:554: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:559: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:558: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:558: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:557: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:557: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:556: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:563: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:562: error: dereferencing pointer ‘ni_req’ does break strict-aliasing rules
asyncns.c:547: note: initialized from here
asyncns.c:575: error: dereferencing pointer ‘res_req’ does break strict-aliasing rules
asyncns.c:580: error: dereferencing pointer ‘res_req’ does break strict-aliasing rules
asyncns.c:580: error: dereferencing pointer ‘res_req’ does break strict-aliasing rules
asyncns.c:582: error: dereferencing pointer ‘res_req’ does break strict-aliasing rules
asyncns.c:582: error: dereferencing pointer ‘res_req’ does break strict-aliasing rules
asyncns.c:571: note: initialized from here
make[4]: *** [asyncns.lo] Error 1
Comment 1 Lennart Poettering 2009-09-03 09:40:38 UTC
You shouldn't use -Werror when building this. The code in asyncns.c breaks C99 strict aliasing ruless.

(BTW, glib now has an async dns module that embedds libasyncns. Might be a good idea to port your code over to that instead of using libasyncns directly)
Comment 2 Guillaume Desmottes 2009-09-14 03:27:30 UTC
http://git.collabora.co.uk/?p=user/cassidy/telepathy-gabble;a=shortlog;h=refs/heads/gibber-error
removes ERROR_CFLAGS when building Gibber.
Comment 3 Guillaume Desmottes 2009-09-14 03:31:49 UTC
I opened bug #23920 about the GResolver switch. I'd prefer to quickly fix this issue without having to block on it as I currently can't build Gabble.
Comment 4 Simon McVittie 2009-09-14 04:56:52 UTC
(In reply to comment #1)
> You shouldn't use -Werror when building this. The code in asyncns.c breaks C99
> strict aliasing rules.

Shouldn't it either not do that, or be documented as "must be compiled with -fno-strict-aliasing", given that AIUI the gcc warnings basically mean "I think I'm applying unsafe optimizations to your code"?
Comment 5 Lennart Poettering 2009-09-14 06:26:53 UTC
(In reply to comment #4)
> (In reply to comment #1)
> > You shouldn't use -Werror when building this. The code in asyncns.c breaks C99
> > strict aliasing rules.
> 
> Shouldn't it either not do that, or be documented as "must be compiled with
> -fno-strict-aliasing", given that AIUI the gcc warnings basically mean "I think
> I'm applying unsafe optimizations to your code"?

Yes, of course, I should fix this. It is on my todo list already, just haven't found the time yet.

I think the meaning of the warning is actually "I am not applying optimizations here because your code stinks", though... ;-) But tbh I neer really verified my interpretation of this.
Comment 6 Simon McVittie 2009-09-14 12:23:24 UTC
*** Bug 23567 has been marked as a duplicate of this bug. ***
Comment 7 Simon McVittie 2009-09-14 12:23:31 UTC
*** Bug 22413 has been marked as a duplicate of this bug. ***
Comment 8 Simon McVittie 2009-09-14 12:24:56 UTC
Guillaume, could you fix this, either by improving asyncns.c or by compiling it with -fno-strict-aliasing?
Comment 10 Guillaume Desmottes 2009-09-16 03:21:27 UTC
Fixed in master. Will be in 0.9.0.
Comment 11 Guillaume Desmottes 2009-09-16 04:32:17 UTC
Fixed in the 0.8 branch as well
Comment 12 Lennart Poettering 2009-10-14 18:34:13 UTC
A small followup:

Upstream libasyncns in git now compiles cleanly with -Wstrict-aliasing. Will release that as 0.8 shortly.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.