The buildbots on Ubuntu produce a warning (e.g. Saucy, GCC 4.8.2) https://launchpadlibrarian.net/170132517/buildlog_ubuntu-saucy-amd64.inkscape-trunk_1%3A0.48%2Bdevel%2B13168%2B47~ubuntu13.10.1_UPLOADING.txt.gz
In file included from ../../src/2geom/interval.h:45:0, from ../../src/2geom/rect.h:45, from ../../src/display/sp-canvas.cpp:26: ../../src/2geom/generic-interval.h: In static member function 'static void SPCanvasGroup::update(SPCanvasItem*, const Geom::Affine&, unsigned int)': ../../src/2geom/generic-interval.h:144:8: warning: '*((void*)(& bounds)+24).Geom::GenericInterval<double>::_b[1]' may be used uninitialized in this function [-Wmaybe-uninitialized] if(val > _b[1]) _b[1] = val; //no else, as we want to handle NaN ^ ../../src/display/sp-canvas.cpp:1051:19: note: '*((void*)(& bounds)+24).Geom::GenericInterval<double>::_b[1]' was declared here Geom::OptRect bounds; ^ In file included from ../../src/2geom/interval.h:45:0, from ../../src/2geom/rect.h:45, from ../../src/display/sp-canvas.cpp:26: ../../src/2geom/generic-interval.h:143:8: warning: '*((void*)(& bounds)+24).Geom::GenericInterval<double>::_b[0]' may be used uninitialized in this function [-Wmaybe-uninitialized] if(val < _b[0]) _b[0] = val; ^ ../../src/display/sp-canvas.cpp:1051:19: note: '*((void*)(& bounds)+24).Geom::GenericInterval<double>::_b[0]' was declared here Geom::OptRect bounds; ^ In file included from ../../src/2geom/interval.h:45:0, from ../../src/2geom/rect.h:45, from ../../src/display/sp-canvas.cpp:26: ../../src/2geom/generic-interval.h:144:8: warning: '*((void*)(& bounds)+8).Geom::GenericInterval<double>::_b[1]' may be used uninitialized in this function [-Wmaybe-uninitialized] if(val > _b[1]) _b[1] = val; //no else, as we want to handle NaN ^ ../../src/display/sp-canvas.cpp:1051:19: note: '*((void*)(& bounds)+8).Geom::GenericInterval<double>::_b[1]' was declared here Geom::OptRect bounds; ^ In file included from ../../src/2geom/interval.h:45:0, from ../../src/2geom/rect.h:45, from ../../src/display/sp-canvas.cpp:26: ../../src/2geom/generic-interval.h:143:8: warning: '*((void*)(& bounds)+8).Geom::GenericInterval<double>::_b[0]' may be used uninitialized in this function [-Wmaybe-uninitialized] if(val < _b[0]) _b[0] = val; ^ ../../src/display/sp-canvas.cpp:1051:19: note: '*((void*)(& bounds)+8).Geom::GenericInterval<double>::_b[0]' was declared here Geom::OptRect bounds; ^
On 2014-03-23 14:05 +0100, Markus Engel wrote:
Hi, neither gcc 4.8.1 nor clang 3.4 nor msvc 12 produce this warning, so I think this might be a false positive that has been fixed in newer compiler versions. I don't see how _b[1] could be not initialized...
Here's the warning I currently like best: ../../trunk/src/gradient-drag.cpp:2390:69: warning: variable 'p' is uninitialized when used within its own initialization [-Wuninitialized] Geom::Point p = ls.pointAt(ls.nearestPoint(dragger->point + p));
Regards, Markus
-----Ursprüngliche Nachricht----- Von: Johan Engelen [mailto:jbc.engelen@...2592...] Gesendet: Sonntag, 23. März 2014 13:24 An: Inkscape-Devel Betreff: [Inkscape-devel] Possibly unitialized used of variable
Hi all, GCC 4.6.1 gives an uninit var warning in sp-canvas.cpp:
src/2geom/generic-interval.h: In static member function 'static void SPCanvasGroup::update(SPCanvasItem*, const Geom::Affine&, unsigned int)':
src/2geom/generic-interval.h:144:8: error: '*((void*)(& bounds)+24).Geom::GenericInterval<double>::_b[1]' may be used uninitialized in this function [-Werror=uninitialized]
src/display/sp-canvas.cpp:1051:19: note: '*((void*)(& bounds)+24).Geom::GenericInterval<double>::_b[1]' was declared here
...
I have been working on this warning for hours, but I cannot find the problem. Because I have already found a (serious) bug from another warning like this, I am very reluctant to conclude that it is a compiler mis-analysis.
I would greatly appreciate someone else having a (thorough) look at this.
Thanks, Johan
-- Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel