I just did a build on Windows and got 1,831 warnings from the compiler.
Mostly minor ones like:
\openmw\apps\openmw\mwworld\refdata.hpp(15): warning C4099: 'ESM::Script' : type name first seen using 'struct' now seen using 'class'
7>..\..\..\apps\openmw\mwrender\renderingmanager.cpp(151): warning C4305: 'argument' : truncation from 'double' to 'float'
7>..\..\..\apps\openmw\mwrender\renderingmanager.cpp(152): warning C4305: 'argument' : truncation from 'double' to 'float'
Funny thing is, I did a full build a few days ago and got none.
Has anyone else who builds on windows noticed the same thing?
I suspect the cause is commit c6aa374934f7ffbcb5bff6ba221cbc61cc1587e7, but I'm not positive.
Warnings when build on Windows
Warnings when build on Windows
Last edited by dteviot on 05 Mar 2015, 09:46, edited 1 time in total.
Re: Warnings when build on Windows
Don't know for sure, but I think there might have been a recent change to CMake.
Re: Warnings when build on Windows
Which means someone(s?) is going to have to fix the warnings.zini wrote:we are aiming for warning-less code
As there's a lot (1,831) some help would be nice.
It would probably also pay to co-ordinate our activity so that we don't double up our efforts.
I'm willing to start by fixing the following errors, as the fix is easy and requires only simple checking to confirm. So I can get rid of these easily and quickly. And so reduce the "noise level' of the warnings.
- C4099: type name first seen using 'struct' now seen using 'class'
- C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
Re: Warnings when build on Windows
The linked commit should not have changed the warning levels. It just sets the warnings globally for all targets to get rid of some copypasta. If there are now different warnings, then we should investigate why cmake isn't passing the flags properly.
Then again, cleaning out the list of ignored warnings sounds like a good idea too. Some of them look like actual problems, e.g. the struct<->class mismatch.
Then again, cleaning out the list of ignored warnings sounds like a good idea too. Some of them look like actual problems, e.g. the struct<->class mismatch.
Re: Warnings when build on Windows
Actually, that's not a problem. It occurs when someone forward declares a class or struct. In C++, the only difference between the two is if the members are public or private by default.scrawl wrote: Then again, cleaning out the list of ignored warnings sounds like a good idea too. Some of them look like actual problems, e.g. the struct<->class mismatch.
i.e. in a header, someone does a forward declaration like
struct Cell;
then later on defines it as a class.
class Cell
{
...
}
Not a problem for compiler.
The warning that takes the time is the float to int conversion. As this results in truncation, need to carefully examine what's going on to make sure the conversion isn't going to cause problems. (I've already found one case where this resulted in an error.)
Re: Warnings when build on Windows
It seems to cause linking errors for MSVC every once in a while. Example: https://bugs.openmw.org/issues/362Not a problem for compiler.
Re: Warnings when build on Windows
That's MSVC 2008.scrawl wrote:It seems to cause linking errors for MSVC every once in a while. Example: https://bugs.openmw.org/issues/362Not a problem for compiler.
I should have said, not a problem for the MSVC 2013 compiler.