gcc spotted this "thing":
FreeOrion/PagedGeometry/source/ImpostorPage.cpp: In member function ‘virtual void Forests::ImpostorPage::build()’:
FreeOrion/PagedGeometry/source/ImpostorPage.cpp:141:70: warning: operation on ‘((Forests::ImpostorPage*)this)->Forests::ImpostorPage::m_vecCenter.Ogre::Vector3::y’ may be undefined [-Wsequence-point]
m_vecCenter.y = m_nAveCount > 0 ? m_vecCenter.y /= m_nAveCount : 0;
I don't think I'm clever enough to outsmart gcc, so, does anybody knows what this is doing and can explain it to me, the comment on the line above that code is not helping...
There's still lots of other warnings, but this one scared me
gcc warns, brain hurt
Moderator: Oberlus
gcc warns, brain hurt
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: gcc warns, brain hurt
It's code in the PagedGeometry library, not FreeOrion code. You'd probably want to ask someone who worked on that library.
We don't maintain a fork of PagedGeometry (even though it's in the FreeOrion SVN repository) so warnings such as this from it or other external library code are ignored.
Also, m_vecCenter gets initialized in the default constructor for ImpostorPage, and that line is checking to avoid divide by zero errors, so I'm not sure what the problem could be...
Also, that code probably won't get used unless you ran the 3D combat demo (which might not even run at all currently).
So, I suggest you don't worry about it, or ask whoever wrote it.
We don't maintain a fork of PagedGeometry (even though it's in the FreeOrion SVN repository) so warnings such as this from it or other external library code are ignored.
Also, m_vecCenter gets initialized in the default constructor for ImpostorPage, and that line is checking to avoid divide by zero errors, so I'm not sure what the problem could be...
Also, that code probably won't get used unless you ran the 3D combat demo (which might not even run at all currently).
So, I suggest you don't worry about it, or ask whoever wrote it.
Re: compiler warns, brain hurt
Hello,
I again met a strange (to me at least) compiler warning. LLVM spotted that :and alsoAre we doing something clever or is the warning real ?
I again met a strange (to me at least) compiler warning. LLVM spotted that :
Code: Select all
/home/vince/repo/upstream/FreeOrion-llvm/universe/System.cpp:219:10: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
if (!this)
Code: Select all
/home/vince/repo/upstream/FreeOrion-llvm/universe/Condition.cpp:233:10: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
if (!this)
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: gcc warns, brain hurt
I think it's just being overly cautious, and these are effectively no-ops.