Bug 485407 - Warning from glibmm/refptr.h
Summary: Warning from glibmm/refptr.h
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibmm24
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Denis Leroy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-13 13:04 UTC by Mamoru TASAKA
Modified: 2009-03-26 18:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-26 18:05:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
src/winmain.h (1.34 KB, text/plain)
2009-02-16 09:25 UTC, Mamoru TASAKA
no flags Details
src/winmain.cpp (5.45 KB, text/plain)
2009-02-16 09:26 UTC, Mamoru TASAKA
no flags Details
winmain.cpp with gcc -E (4.30 MB, text/plain)
2009-02-18 08:13 UTC, Mamoru TASAKA
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 571700 0 None None None Never

Description Mamoru TASAKA 2009-02-13 13:04:36 UTC
Description of problem:
When compiling JD 2.2.0 released (which depends on glibmm24 and
gtkmm24) with glibmm 2.19.1/2.19.2, there are some warnings
from /usr/include/glibmm-2.4/glibmm/refptr.h,

ref:
http://koji.fedoraproject.org/koji/buildinfo?buildID=81973
------------------------------------------------------------------
make[3]: Entering directory `/builddir/build/BUILD/jd-2.2.0-rc090208/src'

g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/cairomm-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include       -I/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -ggdb -Wall -DGTKMMVER=2120 -DUSE_XSMP -MT winmain.o -MD -MP -MF .deps/winmain.Tpo -c -o winmain.o winmain.cpp

/usr/include/glibmm-2.4/glibmm/refptr.h: In constructor 'WinMain::WinMain(bool)':
/usr/include/glibmm-2.4/glibmm/refptr.h:172: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules
/usr/include/glibmm-2.4/glibmm/refptr.h:285: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules
/usr/lib/gcc/i386-redhat-linux/4.4.0/../../../../include/c++/4.4.0/bits/stl_list.h:219: note: initialized from here
/usr/include/glibmm-2.4/glibmm/refptr.h: In constructor 'WinMain::WinMain(bool)':
/usr/include/glibmm-2.4/glibmm/refptr.h:172: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules
/usr/include/glibmm-2.4/glibmm/refptr.h:285: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules
/usr/lib/gcc/i386-redhat-linux/4.4.0/../../../../include/c++/4.4.0/bits/stl_list.h:219: note: initialized from here
--------------------------------------------------------------------

Would you investigate this? (JD uses parallel make so debug message
output is somewhat not in the right order, however it seems
that these warnings come when compiling src/winmain.cpp)

JD upstream does not seem to have g++44. If JD size needs fixing
and you can provide a patch for JD, I will report to JD upstream

Version-Release number of selected component (if applicable):
glibmm24 2.19.1/2.19.2
jd-2.2.0-1.fc11.i386
gcc-c++-4.4.0-0.17.i386

How reproducible:
100%

Steps to Reproduce:
1. See above
2.
3.

Comment 1 Denis Leroy 2009-02-14 06:41:10 UTC
No changes with glibmm 2.19.2. Filed upstream.

Comment 2 Murray Cumming 2009-02-16 08:40:26 UTC
I don't know what the warning means, but I suspect it would be a problem with a regular pointer, not just the RefPtr smartpointer. Maybe someone could attach the source file - it might give us more clues.

Comment 3 Mamoru TASAKA 2009-02-16 09:25:24 UTC
Created attachment 332013 [details]
src/winmain.h

(In reply to comment #2)
> Maybe someone could attach
> the source file - it might give us more clues.

Okay. This is src/winmain.h

Comment 4 Mamoru TASAKA 2009-02-16 09:26:07 UTC
Created attachment 332014 [details]
src/winmain.cpp

and this is src/winmain.cpp

Comment 5 Murray Cumming 2009-02-16 09:54:19 UTC
Could you try commenting lines out to see what line is triggering it?
Maybe it's this one:
std::list< Glib::RefPtr< Gdk::Pixbuf > > list_icons;

Comment 6 Denis Leroy 2009-02-16 10:01:18 UTC
The following test code triggers the warning. You need to compile with -O2 -Wall


#include <gtkmm.h>

void foo(void)
{
    std::list< Glib::RefPtr< Gdk::Pixbuf > > list;
    list.push_back( Gdk::Pixbuf::create_from_inline(0, NULL) );
    Gtk::Window::set_default_icon_list( list_icons );

Comment 7 Murray Cumming 2009-02-16 10:06:47 UTC
I wonder if this is this g++ bug, maybe not yet in Fedora's g++ version:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38937

Comment 8 Mamoru TASAKA 2009-02-18 08:05:00 UTC
CCing to Jakub.

Comment 9 Mamoru TASAKA 2009-02-18 08:13:39 UTC
Created attachment 332344 [details]
winmain.cpp with gcc -E

Jakub, would you investigate how to fix this?

Now with gcc-4.4.0-0.20.i586 the warning on 
/usr/include/glibmm-2.4/glibmm/refptr.h:172 disappeared, however
warning on /usr/include/glibmm-2.4/glibmm/refptr.h:285 still appears
as:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1135010

src/winmain.cpp with gcc -E is attached.

-------------------------------------------------------------
$ LANG=C gcc -v
Using built-in specs.
Target: i586-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog=/builddir/build/BUILD/gcc-4.4.0-20090216/cloog-ppl/inst/usr --with-tune=generic --with-arch=i586 --build=i586-redhat-linux
Thread model: posix
gcc version 4.4.0 20090217 (Red Hat 4.4.0-0.20) (GCC) 
----------------------------------------------------------------

Comment 10 Mamoru TASAKA 2009-02-20 07:03:53 UTC
With gcc-4.4.0-0.21 all warnings disappeared...

Comment 11 Murray Cumming 2009-02-20 13:43:23 UTC
Thanks for checking. Now I don't have to try to understand it.

Comment 12 Mamoru TASAKA 2009-03-26 18:05:03 UTC
Closing, as these warnings no longer appear with the latest
gcc.


Note You need to log in before you can comment on or make changes to this bug.