Anoying warning

souvarine

04-01-2010 21:41:25

When using MyGUI 2.2.3 with Gcc I get this warning

/usr/local/include/MYGUI/MyGUI_TextView.h: In constructor ‘MyGUI::LineInfo::LineInfo()’:
/usr/local/include/MYGUI/MyGUI_TextView.h:41: warning: ‘MyGUI::LineInfo::count’ will be initialized after
/usr/local/include/MYGUI/MyGUI_TextView.h:40: warning: ‘int MyGUI::LineInfo::offset’
/usr/local/include/MYGUI/MyGUI_TextView.h:37: warning: when initialized here


Looking in MyGUI_TextView.h at line 35

struct LineInfo
{
LineInfo() : width(0), count(0), offset(0) { }
void clear() { width = 0; count = 0; simbols.clear(); offset = 0; }
int width;
int offset;
size_t count;
VectorCharInfo simbols;
};

the constructor initialise offset after count even though they are declared in reverse order in the struct. Gcc is picky on details like that. Changing the constructor to
LineInfo() : width(0), offset(0), count(0) { }
would remove the warning.

Regards,
Souvarine.

Altren

04-01-2010 21:53:13

Well, it was fixed in trunk long time ago and probably we forgot to merge it into tag. I changed code, so you can either just change your local copy or download svn snapshot of MyGUI 2.2 there http://my-gui.svn.sourceforge.net/viewv ... z?view=tar