On Sun, Dec 30, 2007 at 05:05:23PM +0000, place wrote:
I get some errors like
html.cc:3832: error: jump to case label html.cc:3808: error: crosses initialization of 'int size' html.cc:3806: error: crosses initialization of 'dw::core::ui::SelectionResource* sel_res
The compiler is happy after I separate it out as
SelectionResource *sel_res; int size; sel_res =(SelectionResource*)((Embed*)input->widget)->getResource(); size = input->select->options->size ();
Thanks for the report. I've attached an updated patch as you suggest. There's no problem with the original code under gcc 3.4.3 . I guess it's one of the things gcc 4.x is more picky about.
I have no idea why that matters to the compiler.
Perhaps the problem is that the variables sel_res and size remain in scope in subsequent cases of the switch, yet if those cases are executed then the variables won't be initialised. What happens if you confine the scope of those variables by putting the body of the case clause inside {...} ? Does the compiler still complain?
SELECT is a milestone because it means I will no longer have any reason to run 0.8.x!
Same here, that's why I was keen to implement it. Regards, Jeremy Henty