Bug #422 QA issues about strict-aliasing

Everything about development and the OpenMW source code.
Post Reply
pi03k
Posts: 10
Joined: 01 Oct 2012, 09:59

Bug #422 QA issues about strict-aliasing

Post by pi03k »

Hi,
http://bugs.openmw.org/issues/422

I think I've corrected the bug (correct me if I'm wrong). Compilation with -Wstrict-aliasing doesn't produce warnings. I've compiled like this:
cd /media/ram/openmw/build/components && /usr/bin/c++ -DOGRE_PLUGIN_DEBUG_SUFFIX=\"_d\" -DOGRE_PLUGIN_DIR=\"\" -DOGRE_PLUGIN_DIR_DBG=\"/usr/lib/OGRE\" -DOGRE_PLUGIN_DIR_REL=\"/usr/lib/OGRE\" -Wstrict-aliasing -fstrict-aliasing -I/media/ram/openmw/. -I/usr/include/OGRE -I/usr/include/OGRE/Ogre -I/usr/include/OGRE/OGRE -I/usr/include/OGRE/Terrain -I/usr/include/OIS -I/usr/include/MYGUI -I/usr/include/AL -I/media/ram/openmw/libs -I/usr/include/bullet -Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++0x -pedantic -Wno-ignored-qualifiers -Wno-unused-but-set-parameter -o CMakeFiles/components.dir/esm/loadlocks.cpp.o -c /media/ram/openmw/components/esm/loadlocks.cpp

I've made Tool & Data templates. Parameters of those templates define type of mUses. mQuality is same old float. Then Probe inherits Tool<int> and Repair Tool<float>.

I've also changed all uses of Tool to Tool<int>.

Last thing I've added are two instantiations of Tool:
template class ESM::Tool<int>;
template class ESM::Tool<float>;

My branch name is bug422 on github.com/Pi03k/openmw.git
Please review my changes and pull.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Bug #422 QA issues about strict-aliasing

Post by Zini »

Commented on the pull request. Again, sorry, my fault. What I wrote in the issue description is nonsense (the part about templates). Should have considered the implications more carefully.
Post Reply