
On 7/14/05, Ralf Stephan <ralf@...748...> wrote:
You wrote
display/sp-canvas.cpp:112: warning: (perhaps the `offsetof' ...
There may be a more local fix available (e.g. similar code elsewhere in Inkscape doesn't generate a warning), but it isn't obvious to me.
I thought I read a list message pointing to a thread on the GCC list (as it was pointed out to be a GCC problem) but can't find that anymore.
There is some truth in that: Older versions of GCC did not report the error properly. According to the C++ standard, we cannot use 0 as the address of a non-POD object. This causes (amongst other things) the offsetof macro to fail on objects with constructors.
Whilst most, if not all, compilers generate correct code - that is, treat this as a warning rather than an error - really we should not use C macros in C++ code.
Probably the best solution is the first one suggested: Move to gtkmm (use C++ techniques throughout). Another possibility would be to move all code requiring the offsetof macro to .c files. Certainly if you can identify what makes the offending cases non-POD and remove it, then that would work as well.
I would suggest that until the best solution is in place, we just live with the warnings.