Suppress -Wmaybe-uninitialized in tlistbox::place()

This commit is contained in:
Jyrki Vesterinen 2016-10-10 20:28:05 +03:00
parent 426d57b4b7
commit d7bb7dc560

View file

@ -313,6 +313,14 @@ bool tlistbox::update_content_size()
return false;
}
/* Suppress -Wmaybe-uninitialized warnings. @GregoryLundberg reported in IRC that GCC 6.2.1 with SCons gives a warning that
* the value of horizontal_scrollbar_position can be used uninitialized. It's of course not possible (boost::optional
* conversion to bool returns true only if the value is set), but GCC can't prove that to itself. */
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
void tlistbox::place(const tpoint& origin, const tpoint& size)
{
boost::optional<unsigned> vertical_scrollbar_position, horizontal_scrollbar_position;
@ -346,6 +354,10 @@ void tlistbox::place(const tpoint& origin, const tpoint& size)
}
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
void tlistbox::resize_content(const int width_modification,
const int height_modification,
const int width_modification_pos,