Skip to content

Fix some MinGW warnings

Adrian Johnson requested to merge ajohnson/cairo:ming-warnings into master

This fixes some warnings the occur during a MinGW build. They only remaining warnings in MinGW are listed below. I'm not sure how to fix them. I assume it is something to do with the MinGW stdio.h. I tried adding -D__USE_MINGW_ANSI_STDIO=1to the build but it did not fix the warnings.

Found ninja-1.10.1 at /usr/bin/ninja
../cairo/src/cairo-tag-stack.c: In function ‘_cairo_tag_error’:
../cairo/src/cairo-tag-stack.c:291:2: warning: function ‘_cairo_tag_error’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  291 |  vprintf (fmt, ap);
      |  ^~~~~~~
[191/666] Compiling C object test/cairo-test-suite.exe.p/cairo-test-runner.c.obj
../cairo/test/cairo-test-runner.c: In function ‘_log’:
../cairo/test/cairo-test-runner.c:113:5: warning: function ‘_log’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  113 |     vprintf (fmt, ap);
      |     ^~~~~~~
[192/666] Compiling C object test/cairo-test-suite.exe.p/cairo-test.c.obj
../cairo/test/cairo-test.c: In function ‘cairo_test_logv’:
../cairo/test/cairo-test.c:267:5: warning: function ‘cairo_test_logv’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  267 |     vfprintf (file, fmt, va);
      |     ^~~~~~~~
[429/666] Compiling C object test/cairo-test-suite.exe.p/overflow.c.obj
../cairo/test/overflow.c: In function ‘check_if_result_fail’:
../cairo/test/overflow.c:107:44: warning: unknown conversion type character ‘l’ in format [-Wformat=]
  107 |         cairo_test_log (ctx, "%s a = 0x%0*llx b = 0x%0*llx result = 0x%0*llx overflow = %d\n",
      |                                            ^
../cairo/test/overflow.c:107:57: warning: unknown conversion type character ‘l’ in format [-Wformat=]
  107 |         cairo_test_log (ctx, "%s a = 0x%0*llx b = 0x%0*llx result = 0x%0*llx overflow = %d\n",
      |                                                         ^
../cairo/test/overflow.c:107:75: warning: unknown conversion type character ‘l’ in format [-Wformat=]
  107 |         cairo_test_log (ctx, "%s a = 0x%0*llx b = 0x%0*llx result = 0x%0*llx overflow = %d\n",
      |                                                                           ^
../cairo/test/overflow.c:107:90: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘long long unsigned int’ [-Wformat=]
  107 |         cairo_test_log (ctx, "%s a = 0x%0*llx b = 0x%0*llx result = 0x%0*llx overflow = %d\n",
      |                                                                                         ~^
      |                                                                                          |
      |                                                                                          int
      |                                                                                         %I64d
......
  112 |                         (unsigned long long)data->b,
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       
      |                         |
      |                         long long unsigned int
../cairo/test/overflow.c:107:30: warning: too many arguments for format [-Wformat-extra-args]
  107 |         cairo_test_log (ctx, "%s a = 0x%0*llx b = 0x%0*llx result = 0x%0*llx overflow = %d\n",
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cairo/test/overflow.c:119:59: warning: unknown conversion type character ‘l’ in format [-Wformat=]
  119 |             cairo_test_log (ctx, "EXPECTED result = 0x%0*llx overflow = 0\n",
      |                                                           ^
../cairo/test/overflow.c:119:34: warning: too many arguments for format [-Wformat-extra-args]
  119 |             cairo_test_log (ctx, "EXPECTED result = 0x%0*llx overflow = 0\n",
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Merge request reports