DarthMike / indielib-crossplatform

IndieLib is a cross-platform Game Graphics engine. Main focus is OpenGL ES 2.0 for mobile iOS operating system, and OpenGL desktop. **NOT SUPPORTED ANYMORE**
zlib License
61 stars 27 forks source link

Reduce all warnings to 0 #27

Closed M-F-K closed 12 years ago

M-F-K commented 12 years ago

We should tolerate no warnings in the project. As far as OpenGL features are ported, we should remove all warnings.


Regarding linux, - At present time, these 4 are the only warnings that are left:

../common/dependencies/TmxParser/TmxMap.cpp: In member function 'void Tmx::Map::ParseFile(const string&)': ../common/dependencies/TmxParser/TmxMap.cpp:137:37: warning: ignoring return value of 'sizet fread(void, size_t, sizet, FILE)', declared with attribute warn_unused_result [-Wunused-result]

../common/dependencies/FreeImage/Source/ZLib/gzwrite.c: In function 'gz_comp': ../common/dependencies/FreeImage/Source/ZLib/gzwrite.c:93:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]

../common/dependencies/FreeImage/Source/ZLib/gzwrite.c: In function 'gzclose_w': ../common/dependencies/FreeImage/Source/ZLib/gzwrite.c:567:5: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]

../common/dependencies/FreeImage/Source/ZLib/gzlib.c: In function 'gz_open': ../common/dependencies/FreeImage/Source/ZLib/gzlib.c:213:9: warning: implicit declaration of function 'lseek' [-Wimplicit-function-declaration]


In linux : found these new ones:

../common/src/IND_AnimationManager.cpp: In member function 'bool IND_AnimationManager::addToSurface(INDAnimation, char_, IND_Type, IND_Quality)': ../common/src/IND_AnimationManager.cpp:117:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../common/src/IND_AnimationManager.cpp: In member function 'bool IND_AnimationManager::addToSurface(INDAnimation, char_, IND_Type, IND_Quality, BYTE, BYTE, BYTE)': ../common/src/IND_AnimationManager.cpp:164:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../common/src/IND_AnimationManager.cpp: In member function 'bool IND_AnimationManager::addToSurface(INDAnimation, char_, int, IND_Type, IND_Quality)': ../common/src/IND_AnimationManager.cpp:203:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../common/src/IND_AnimationManager.cpp: In member function 'bool IND_AnimationManager::addToSurface(INDAnimation, char_, int, IND_Type, IND_Quality, BYTE, BYTE, BYTE)': ../common/src/IND_AnimationManager.cpp:246:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

M-F-K commented 12 years ago

in Linux: this is new: ../common/src/IND_Entity2d.cpp: In member function 'void IND_Entity2d::initAttrib()': ../common/src/IND_Entity2d.cpp:913:18: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

DarthMike commented 12 years ago

Changed warning settings for mac in XCode, by adding additional checks. Reduced warning # to 0 in mac as of today.

DarthMike commented 12 years ago

Should enable 'treat warnings as errors' when this issue is fixed for all platforms. Then we will ensure 'no warning policy'.

DarthMike commented 12 years ago

Fixed all warnings for win too. Treating warnings as errors on MSVC and LLVM (OSX)

M-F-K commented 12 years ago

Only have the "implicit warnings" left in the Freeimage Zlib dependencies. Should we try to correct these? or should we assume that the Freeimage project fixes these later on? great work by the way =)

DarthMike commented 12 years ago

Maybe remove -Wimplicit-function-declaration flag? Do we really need this flag to ensure safe code?

M-F-K commented 12 years ago

[llinux] build now has 0 warning. - there was some warnings in the dependencies (not in Indielib code), these have been hidden with these switches: -Wno-implicit-function-declaration -Wno-error=unused-result.

... can we close this issue now?

DarthMike commented 12 years ago

YES!