Re #8997. Fix gcc warnings
Merge branch 'bugfix/8997_cppcheck_errors_in_instrumentwindow' into develop