Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows build warnings #10

Open
8 tasks done
Wohlstand opened this issue Nov 26, 2018 · 7 comments
Open
8 tasks done

Fix Windows build warnings #10

Wohlstand opened this issue Nov 26, 2018 · 7 comments
Assignees

Comments

@Wohlstand
Copy link
Member

Wohlstand commented Nov 26, 2018

  • libID3Tag:
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libid3tag-sdl\src\id3_file.c: In function 'new_file_private':
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libid3tag-sdl\src\id3_file.c:507:35: warning: implicit declaration of function 'strdup' [-Wimplicit-function-declaration]
     file->path    = path ? (char*)strdup(path) : nullP;
                                   ^
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libid3tag-sdl\src\id3_file.c: In function 'id3_file_fdopen':
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libid3tag-sdl\src\id3_file.c:605:22: warning: implicit declaration of function 'fdopen' [-Wimplicit-function-declaration]
     iofile = (FILE *)fdopen(fd, (mode == ID3_FILE_MODE_READWRITE) ? "r+b" : "rb");
  
  • libOPNMIDI:
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2\fmgen_opna.cpp:118:12: warning: comparison is always true due to limited range of data type [-Wtype-limits]
   assert(0 <= prescale && prescale < 3);
``
C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2_opna.cpp(78): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs-build\libOPNMIDI\OPNMIDI_static.vcxproj] [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\AudioCodecs.vcxproj]

:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2\fmgen_file.cpp(108): warning C4267: '=': conversion from 'size_t' to 'uint32', possible loss of data [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs-build\libOPNMIDI\OPNMIDI_static.vcxproj] [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\AudioCodecs.vcxproj]
C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2\fmgen_file.cpp(123): warning C4267: '=': conversion from 'size_t' to 'uint32', possible loss of data [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs-build\libOPNMIDI\OPNMIDI_static.vcxproj] [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\AudioCodecs.vcxproj]
C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2\fmgen_file.cpp(153): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs-build\libOPNMIDI\OPNMIDI_static.vcxproj] [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\AudioCodecs.vcxproj]
    fmgen_fmgen.cpp
C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2\fmgen_fmgen.cpp(431): warning C4018: '>=': signed/unsigned mismatch [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs-build\libOPNMIDI\OPNMIDI_static.vcxproj] [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\AudioCodecs.vcxproj]
C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs\libOPNMIDI\src\chips\np2\fmgen_fmgen.cpp(548): warning C4018: '>=': signed/unsigned mismatch [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\external\AudioCodecs\src\AudioCodecs-build\libOPNMIDI\OPNMIDI_static.vcxproj] [C:\projects\sdl-mixer-x\build-MSVC15-Debug-x64\AudioCodecs.vcxproj]
  • libOPNMIDI: (Again)
C:\projects\libopnmidi\src\chips\np2\fmgen_fmgen.cpp(431): warning C4018: '>=': signed/unsigned mismatch [C:\projects\libopnmidi\build-MSVC15-Debug-x64\OPNMIDI_shared.vcxproj]
C:\projects\libopnmidi\src\chips\np2\fmgen_fmgen.cpp(548): warning C4018: '>=': signed/unsigned mismatch [C:\projects\libopnmidi\build-MSVC15-Debug-x64\OPNMIDI_shared.vcxproj]
  • libFLAC:
C:/projects/sdl-mixer-x/build-MinGW-Debug-Win32/external/AudioCodecs/src/AudioCodecs/libFLAC/include_p/share/compat.h:92:27: warning: implicit declaration of function '_strnicmp' [-Wimplicit-function-declaration]
 #define FLAC__STRNCASECMP _strnicmp
                           ^
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libFLAC\src\libFLAC\metadata_object.c:1386:76: note: in expansion of macro 'FLAC__STRNCASECMP'
   return (eq != NULL && (uint32_t)(eq-entry.entry) == field_name_length && FLAC__STRNCASECMP(field_name, (const char *)entry.entry, field_name_length) == 0);
 
  • libGME:
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libgme\src\Data_Reader.cpp:375:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if ( file_ && s > 0 && s <= UINT_MAX ) {
                           ^
In file included from C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libgme\src\Data_Reader.cpp:21:0:
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libgme\src\Data_Reader.cpp: In member function 'virtual const char* Std_File_Reader::read(void*, long int)':
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libgme\src\Data_Reader.cpp:389:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  RETURN_VALIDITY_CHECK( s > 0 && s <= UINT_MAX );
                                    ^
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libgme\src\blargg_source.h:28:44: note: in definition of macro 'unlikely'
     #define unlikely( x ) __builtin_expect(x, 0)
                                            ^
C:\projects\sdl-mixer-x\build-MinGW-Debug-Win32\external\AudioCodecs\src\AudioCodecs\libgme\src\Data_Reader.cpp:389:2: note: in expansion of macro 'RETURN_VALIDITY_CHECK'
  RETURN_VALIDITY_CHECK( s > 0 && s <= UINT_MAX );
  ^
  • libSDL2:
C:/projects/sdl-mixer-x/build-MinGW-Debug-Win32/external/AudioCodecs/src/AudioCodecs-build/include/SDL2/SDL_touch.h:49:39: warning: comma at end of enumerator list [-Wpedantic]
     SDL_TOUCH_DEVICE_INDIRECT_RELATIVE, /* trackpad with screen cursor-relative coordinates */
                                       ^

I guess, @sezero , can you fix this (remove the comma to don't break C90 compatibility of public hraders) without letting me to create one another bugzilla issue?

  • ZLib (after update)
[00:05:59] C:\projects\audiocodecs\zlib\zlib\gzread.c(319): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\projects\audiocodecs\build-MSVC15-Debug-x64\zlib\zlibstatic.vcxproj]
[00:05:59] C:\projects\audiocodecs\zlib\zlib\gzread.c(400): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\projects\audiocodecs\build-MSVC15-Debug-x64\zlib\zlibstatic.vcxproj]
[00:05:59] C:\projects\audiocodecs\zlib\zlib\gzread.c(472): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\audiocodecs\build-MSVC15-Debug-x64\zlib\zlibstatic.vcxproj]
[00:05:59]   gzwrite.c
[00:05:59] C:\projects\audiocodecs\zlib\zlib\gzwrite.c(212): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\projects\audiocodecs\build-MSVC15-Debug-x64\zlib\zlibstatic.vcxproj]
[00:05:59] C:\projects\audiocodecs\zlib\zlib\gzwrite.c(232): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\projects\audiocodecs\build-MSVC15-Debug-x64\zlib\zlibstatic.vcxproj]
[00:05:59] C:\projects\audiocodecs\zlib\zlib\gzwrite.c(371): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\audiocodecs\build-MSVC15-Debug-x64\zlib\zlibstatic.vcxproj]

  • libMAD:
[00:06:12] C:\projects\audiocodecs\libmad\src\layer3.c(1063): warning C4018: '<': signed/unsigned mismatch [C:\projects\audiocodecs\build-MSVC15-Debug-x64\libmad\mad.vcxproj]
[00:06:12] C:\projects\audiocodecs\libmad\src\layer3.c(1112): warning C4018: '<': signed/unsigned mismatch [C:\projects\audiocodecs\build-MSVC15-Debug-x64\libmad\mad.vcxproj]
[00:06:12] C:\projects\audiocodecs\libmad\src\layer3.c(1154): warning C4018: '<': signed/unsigned mismatch [C:\projects\audiocodecs\build-MSVC15-Debug-x64\libmad\mad.vcxproj]
[00:06:12] C:\projects\audiocodecs\libmad\src\layer3.c(2476): warning C4018: '>': signed/unsigned mismatch [C:\projects\audiocodecs\build-MSVC15-Debug-x64\libmad\mad.vcxproj]
@Wohlstand Wohlstand self-assigned this Nov 26, 2018
@sezero
Copy link
Collaborator

sezero commented Nov 26, 2018

C:/projects/sdl-mixer-x/build-MinGW-Debug-Win32/external/AudioCodecs/src/AudioCodecs-build/include/SDL2/SDL_touch.h:49:39: warning: comma at end of enumerator list [-Wpedantic]
     SDL_TOUCH_DEVICE_INDIRECT_RELATIVE, /* trackpad with screen cursor-relative coordinates */
                                       ^

This one is fixed in SDL hg repo.

@Wohlstand
Copy link
Member Author

@sezero , Thanks! 🦊 👍

@Wohlstand
Copy link
Member Author

libOPNMIDI fixes: Wohlstand/libOPNMIDI@bdeb0b0

@Wohlstand
Copy link
Member Author

Okay, all those warnings has been fixed, I hope no more new of them will appear...

@Wohlstand
Copy link
Member Author

ZLib and libMAD are still have MSVC warnings

@Wohlstand
Copy link
Member Author

Warnings at libMAD has been fixed, at ZLib was muted.

@Wohlstand
Copy link
Member Author

Also, libID3Tag had some warnings in debug build I have fixed quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants