On Sat, Jun 25, 2011 at 8:24 AM, Jasper van de Gronde <th.v.d.gronde@...528...> wrote:
On 2011-06-25 8:05, Campbell Barton wrote:
Hi, I was trying to compile inkscape with clang, and for many reasons this failed, however one looks like it should probably be fixed in the code.
src/ui/widget/registered-widget.h
operator const Gtk::Widget () { return dynamic_castGtk::Widget*(this); }
Should either be: operator const Gtk::Widget () { return *dynamic_castGtk::Widget*(this); } Or: operator const Gtk::Widget () { return dynamic_castGtk::Widget(this);
I'm actually a little surprised that it returns a COPY of a Gtk::Widget. It might be more appropriate to return a Gtk::Widget pointer. But in any case I'm a little surprised that this isn't caught using gcc, which makes we wonder whether this is used at all.
BTW, insanely cool that you're trying to use clang to build Inkscape, I'd love to know if and when you succeed.
There are a few issues that will need to be resolved, but will try 1 by 1, when I get time.
Not sure if you guys are familiar with the static checker, This is an older scan of blenders source, we're down to ~600 reports now.
http://www.graphicall.org/ftp/ideasman42/2011-01-07-2/
I found this really useful, many of the reports can be ignored but some of the checks are almost always real bugs - "Result of operation is garbage or undefined" for eg.
Since blender already built on MSVC/ICC/GCC getting clang working wasn't so hard but it seems inkscape is GCC only and uses a few features not supported in other compilers, Even so, since clang has gcc compatibility it may not be too much work.