Cxbx-reloaded: Remove all compiler hints and warnings

Created on 23 Dec 2016  路  7Comments  路  Source: Cxbx-Reloaded/Cxbx-Reloaded

Having no compiler hints and warnings gives a much cleaner build.

Causing new compiler messages should be forbidden - if any appear, the person responsible for that should fix it.

enhancement help wanted

Most helpful comment

In an ideal world, our code shouldn't raise any warning even when the compiler uses its most thorough validation methods. But right now it might not be feasible to reach that level of confirmation to the highest possible standards

All 7 comments

Agreed, the flag to treat warnings as errors should be set, and perhaps raise the error level?

However, as there are copies of specific SDKs some files will flagged as deprecated, ie GetVersionExA in multimon.h from import\DirectX8\include\multimon.h

Fixes from #100 have helped with this issue.

The biggest issue left is the alignment of XBE and EXE structures - as the use of #include "AlignPosfix1.h" is not really supported with other compilers.

Otherwise there are just lots of printf-style format specifiers which need updating!

Ah, also the device enumeration callback issue which I don't know how to solve yet:

1>..\..\src\Common\Win32\XBController.cpp(933,13): error : use of undeclared identifier 'WrapEnumGameCtrlCallback'
1>              WrapEnumGameCtrlCallback,
1>              ^
1>..\..\src\Common\Win32\XBController.cpp(973,60): error : use of undeclared identifier 'WrapEnumObjectsCallback'
1>          m_InputDevice[m_dwCurObject].m_Device->EnumObjects(WrapEnumObjectsCallback, this, DIDFT_ALL);
1>                                                             ^

If we're trying to get rid of warnings maybe the warning level should be raised?
capture

Our own code should generate warnings, imported code shouldn't.

In an ideal world, our code shouldn't raise any warning even when the compiler uses its most thorough validation methods. But right now it might not be feasible to reach that level of confirmation to the highest possible standards

Moving comment to here from #1262 conversation.

There's no way to treat warning as error level to be raise. The option is either treat warning as error or warning. See "Treat Warnings as Errors" option.

Visual Studio's "Warning Level" is entirely different thing. It only verbose more warnings to alert the developers about something need to be fix before sending new release to public or private group.

And other comment from #1259

Since we are "stuck" with deprecated GetVersion function from CxbxKrnl.cpp file. Plus other solution I discover are using Windows' API. We are not able to treat warning as error for time being.

Plus it is best to move part of the code for Operating System build check into their own directory, Win32 and Linux.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PatrickvL picture PatrickvL  路  3Comments

PatrickvL picture PatrickvL  路  4Comments

childishbeat picture childishbeat  路  4Comments

LukeUsher picture LukeUsher  路  4Comments

PatrickvL picture PatrickvL  路  3Comments