Proposed Fixes for Various GCC Warnings - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: Proposed Fixes for Various GCC Warnings (/showthread.php?tid=30129) Pages:
1
2
|
Proposed Fixes for Various GCC Warnings - monkeyman - 2007-12-16 I've looked through all the warnings that GCC generates when compiling the current SVN for the linuxport with the -Wall flag set. The following warnings can be fixed with very little effort: Code: GUIFont.cpp:51: warning: unused variable ‘nw’ Code: FileCache.h:57:2: warning: no newline at end of file Code: VideoDatabase.cpp:3790: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’ Code: XBMChttp.cpp:2350: warning: control reaches end of non-void function In UnrarXlib: Code: file.cpp: In member function ‘Int64 File::Tell()’: Code: file.cpp:8: warning: ‘CreatedFiles’ defined but not used Code: filefn.cpp:111: warning: unused variable ‘sm’ Code: Thread.cpp:97: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 4 has type ‘Uint32’ Code: pathfn.cpp:8: warning: unused variable ‘Found’ Code: rar.cpp:349: warning: unused variable ‘TitleShown’ Code: DVDOverlayRenderer.cpp:56: warning: unused variable ‘ey’ Code: winxml.cpp:157: warning: unused variable ‘bRefresh’ Code: EncoderWav.cpp:75: warning: passing NULL to non-pointer argument 2 of ‘DWORD SetFilePointer(CXHandle*, LONG, LONG*, DWORD)’ Code: SetFilePointer(m_hFile, 0, NULL, FILE_BEGIN); These are all pretty trivial, so I doubt any developers will care that much about them. However, fixing/silencing these may make finding "real" warnings easier. - spiff - 2007-12-25 please, speak diff or somebody has to do all the work you just did all over again - monkeyman - 2007-12-25 Yes. I'll generate some diffs and post them when I get a chance. Please submit any patches to our tracker on sourceforge.net - Gamester17 - 2007-12-25 http://xboxmediacenter.com/wiki/HOW-TO_submit_a_patch http://xboxmediacenter.com/wiki/Linux_port_project Thanks - jmarshall - 2007-12-26 Thanks - just a note for whoever implements these: Most of them apply to trunk, so please apply them there first, or let me know when it's done and I'll merge them back. - monkeyman - 2007-12-26 Here's part of the patch. However, I can't get linuxport head to compile. Some of the xrandr stuff seems to have broken compilation. Code: Index: xbmc/VideoDatabase.cpp I'll upload the full patch to sourceforge once I can get svn to compile. - monkeyman - 2007-12-26 Here's the compile-time error, that I got: Code: GraphicContext.cpp: In member function ‘void CGraphicContext::SetVideoResolution(RESOLUTION&, BOOL, bool)’: - monkeyman - 2007-12-26 It seems that when I install libxrandr-dev that the compilation error is fixed. Maybe these should be #ifdef'd out if not installed? - monkeyman - 2007-12-26 Now I get this error: Code: In file included from FileFactory.cpp:34: Any ideas? Thanks. - monkeyman - 2007-12-26 I'm sorry, I guess I should read the damn README file next time. Nevermind. I'm an idiot. - tslayer - 2007-12-26 Check the Readme.Linux file. Specifically the apt-get stuff you need. I believe libmms is now needed. Edit: Disregard. Looks like we posted at the same time. - d4rk - 2007-12-26 SVN 11098+ will autodetect libmms, making it optional. - monkeyman - 2007-12-26 Thanks. I've uploaded my patch to sourceforge: https://sourceforge.net/tracker/index.php?func=detail&aid=1858654&group_id=87054&atid=581840 - monkeyman - 2007-12-28 I've uploaded a second patch that fixes some other GCC warnings. Compilations are now nearly warning-free! https://sourceforge.net/tracker/index.php?func=detail&aid=1859434&group_id=87054&atid=581840 - monkeyman - 2007-12-29 Here's a large number of gcc warnings fixes when the linuxport source is compiled with the -Wextra and -pedantic flags. The majority of these fixes involve removing extra commas and semicolons in .h files that are not ISO C++ compliant. For example: namespaces should not be followed by a ';' the last element in an enumeration should not be followed by a ',' Additionally, there are a few (3-4) fixes for comparison between signed and unsigned variables. I tried to follow the intent of the original code when making changes. Nevertheless, these changes may need to be reviewed by an XBMC team member. Finally, xbmc/linux/PlatformDefs.h contains a few anonymous structs. However, anonymous structs are NOT legal in ISO C++. I did not attempt to fix these because I fear that my changes may break something. Overall, these changes should make it easier to compile the code under different compilers than gcc and MSVC. https://sourceforge.net/tracker/index.php?func=detail&aid=1860228&group_id=87054&atid=581840 |