Addressed warnings when compiling on MinGW/MSYS

Following warnings still remain so far.

src/tuxpaint.c:199:2: warning: #warning "Attempting to define strcasestr(); if errors, build with -DHAVE_STRCASESTR" [-Wcpp]
  199 | #warning "Attempting to define strcasestr(); if errors, build with -DHAVE_STRCASESTR"
      |  ^~~~~~~

src/parse.gperf: In function 'parse_one_option':
src/parse.gperf:306:45: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type 'char *' as the destination; expected 'char' or an explicit length [-Wsizeof-pointer-memaccess]
  306 |   memcpy(offset+(char*)tmpcfg, &opt, sizeof(char*)); /* FIXME: This causes a warning; should it be 'sizeof(char)', or do we need to have the warning suppressed? -bjk 2021.10.14 */
      |                                             ^~~~

src/dirwalk.c: In function 'tp_ftw':
src/dirwalk.c:348:2: warning: #warning Failed to see DT_UNKNOWN [-Wcpp]
  348 | #warning Failed to see DT_UNKNOWN
      |  ^~~~~~~

src/get_fname.c: In function 'get_fname':
src/get_fname.c💯3: warning: 'dir' may be used uninitialized in this function [-Wmaybe-uninitialized]
  100 |   snprintf(f, sizeof(f),
      |   ^~~~~~~~~~~~~~~~~~~~~~
  101 |            "%s%c%s",
      |            ~~~~~~~~~
  102 |     dir, (*name) ? '/' : '\0', /* Some mkdir()'s don't like trailing slashes */
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103 |     name);
      |     ~~~~~

magic/src/cartoon.c:178:99: warning: unused parameter 'last' [-Wunused-parameter]
  178 | static void do_cartoon(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y)
      |                                                                                     ~~~~~~~~~~~~~~^~~~
This commit is contained in:
dolphin6k 2021-11-05 12:23:09 +09:00
parent ee83ee090e
commit 7c8f6bca80
4 changed files with 17 additions and 6 deletions

View file

@ -64,6 +64,9 @@
#include "debug.h"
#ifdef WIN32
extern char *strcasestr(const char *haystack, const char *needle);
#endif
/* Directory walking callers and callbacks */