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

Fixes for most compiler warnings using GCC 7.3.0 and mingw-w64. #494

Merged
merged 4 commits into from
Mar 20, 2018

Conversation

JPeterMugaas
Copy link
Contributor

patching file src/config.h
Add an UNUSED macro to set the unused gcc attribute to fix compiler warnings
patching file src/fileio.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/flif.cpp
Fix unused parameter warnings with UNUSED macro
patching file src/flif-dec.cpp
Fix unused parameter warnings with UNUSED macro
patching file src/flif-enc.cpp
Fix unused parameter warnings with UNUSED macro
patching file src/viewflif.c
add a copy of the UNUSED macro here so the example will compile without warnings
fix warnings about an invalid format string. mingw-w64 uses something different than MS Visual C.
Fix sign-comparison warnings between uint32_t and int. Some of that is because the SDL API uses int while FLIF uses uint32_t.
patching file src/image/image.hpp
Fix unused parameter warnings with UNUSED macro
Add "falls through" comment to some case statements to eliminate GCC warnings about fallthrough.
patching file src/library/flif_common.h
MINGW32 also requires dllimport/dllexport
patching file src/library/flif-interface-private_common.hpp
MINGW32 also requires dllexport
patching file src/maniac/compound.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/maniac/rac_enc.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/transform/colorbuckets.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/transform/framecombine.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/transform/transform.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/transform/palette_C.hpp
Fix unused parameter warnings with UNUSED macro
patching file src/transform/ycocg.hpp
Fix unused parameter warnings with UNUSED macro

patching file src/config.h
  Add an UNUSED macro to set the unused gcc attribute to fix compiler warnings
patching file src/fileio.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/flif.cpp
  Fix unused parameter warnings with UNUSED macro
patching file src/flif-dec.cpp
  Fix unused parameter warnings with UNUSED macro
patching file src/flif-enc.cpp
  Fix unused parameter warnings with UNUSED macro
patching file src/viewflif.c
  add a copy of the UNUSED macro here so the example will compile without warnings
  fix warnings about an invalid format string.  mingw-w64 uses something different than MS Visual C.
  Fix sign-comparison warnings between uint32_t and int.  Some of that is because the SDL API uses int while FLIF uses uint32_t.
patching file src/image/image.hpp
   Fix unused parameter warnings with UNUSED macro
   Add "falls through" comment to some case statements to eliminate GCC warnings about fallthrough.
patching file src/library/flif_common.h
  __MINGW32__ also requires dllimport/dllexport
patching file src/library/flif-interface-private_common.hpp
  __MINGW32__ also requires dllexport
patching file src/maniac/compound.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/maniac/rac_enc.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/transform/colorbuckets.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/transform/framecombine.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/transform/transform.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/transform/palette_C.hpp
  Fix unused parameter warnings with UNUSED macro
patching file src/transform/ycocg.hpp
  Fix unused parameter warnings with UNUSED macro
1) Build static versions (flif and flif-dec)
2) Add "-mavx" for Win32 builds using GCC.  That is necessary for i686 binaries:

The ABI for passing parameters with 16-byte alignment has changed in GCC 4.6

3( build dflif
4) Have the source files match what the makefile builds
5) Build gdk-pixbuf2 loaders (both as static and shared libraries)
6) add test for static flif library builds
7) add install for viewer, gdk-pixbuf2 loaders, flif and flic-dec libraries, manual pages, shared-mime info, .magic file, licenses, as well as the gif2flif and apng2flif scripts.
8) Unlike make, the CMakeLists files does NOT call update-mime-database, append stuff to the file packages /etc/magic, or gdk-pixbuf-query-loaders --update-cache.  This is deliberate because those should be done when installing on a user's system, not when building a binary package for redistribution using Pacman, rpm, or dpkg.
…be more cross-platofm.

Note that for MINGW-W64, I had to use __USE_MINGW_ANSI_STDIO 1

Which should help make it run even with older versioms of msvcrt.dll that didn't support the GNU stan dard macros.

Using __STDC_FORMAT_MACROS permits you to use he constant even from C++.
build/MSVC/getopt/getopt.c - fix GCC warnings about code misteknly indented to imply it was guarded when it wasn't.  GCC warns about such things.
CMakeLists.txt - use C compiler instead of C++ compiler.  Clang depreciates that and it was also preventing me from using macros from inttypes.h.
src/config.h - Rename UNUSED maco to FLIF_UNUSUSED.  Also added a FALLTHROUGH macro from Graphite2.
src/fileio.cpp, src/flif.cpp, flif-dec.cpp, flif-enc.cpp - adjust for macro rename
src/pixbuf-loaders.c - fix warnings about unsigned comparisons
viewflif - remove define for C++.  It should be compiled with the C compiler instead.  Rename UNUSED maco and rwork things so it can work with MINGW-W64 and MSC.  Use inttype.h macros when we can.
images.cpp - adjust for macro rename
flif-common.  Change define for DLL import to Win32 since this is a common Windows-specific thing.  Yes, ther
e is clang and GCC for Windows.
fliif-enc.h, flinf-inerface_enc.cpp - fix Clang error.  dllimport can not be used on a non-inline function.
flif_interface-private_common.hpp - dllexport and import ifdef changed to _WIN32
tools/test.c - fix warning about signed compares as well issues with using int and long.  In Win64, those do not grow to 64-bits.  In addition, I wanted to use 64-bit file functions for all Windows versions.
@jonsneyers jonsneyers merged commit 9db26f8 into FLIF-hub:master Mar 20, 2018
@jonsneyers
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants