Re #7876. Fix for compilers that don't do initializer lists.
Re #7876. Remove compiler warning.

Hope that naming the variable prevents the compiler optimizing it away.
Merge branch 'feature/7876_coverity_errors' into develop