curl/include/curl
Viktor Szakats e512fbfa67
printf: fix mingw-w64 format checks
Change mingw-w64 printf format checks in public curl headers to use
`__MINGW_PRINTF_FORMAT` instead of `gnu_printf`. This syncs the format
checker with format string macros published via `curl/system.h`. (Also
disable format checks for mingw-w64 older than 3.0.0 (2013-09-20) and
classic-mingw, which do not support this macro.)

This fixes bogus format checker `-Wformat` warnings in 3rd party code
using curl format strings with the curl printf functions, when using
mingw-w64 7.0.0 (2019-11-10) and older (with GCC, MSVCRT).

It also allows to delete two workaounds for this within curl itself:
- setting `-D__USE_MINGW_ANSI_STDIO=1` for mingw-w64 via cmake and
  configure for `docs/examples` and `tests/http/clients`.
  Ref: c730c8549b #14640

The format check macro is incompatible (depending on mingw-w64 version
and configuration) with the C99 `%z` (`size_t`) format string used
internally by curl.

To work around this problem, override the format check style in curl
public headers to use `gnu_printf`. This is compatible with `%z` in all
mingw-w64 versions and allows keeping the C99 format strings internally.

Also:
- lib/ws.c: add missing space to an error message.
- docs/examples/ftpgetinfo.c: fix to use standard printf.

Ref: #14643 (take 1)
Follow-up to 3829759bd0 #12489

Closes #14703
2024-09-02 21:03:01 +02:00
..
.gitignore copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
curl.h printf: fix mingw-w64 format checks 2024-09-02 21:03:01 +02:00
curlver.h RELEASE-NOTES: synced 2024-07-31 10:48:48 +02:00
easy.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
header.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am build: untangle CURLDEBUG and DEBUGBUILD macros 2024-05-28 08:12:00 +02:00
mprintf.h printf: fix mingw-w64 format checks 2024-09-02 21:03:01 +02:00
multi.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
options.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
stdcheaders.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
system.h tidy-up: spelling 'built-in' 2024-08-20 21:32:40 +02:00
typecheck-gcc.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
urlapi.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
websockets.h websocket: rename arguments/variables to match docs 2023-07-22 00:31:31 +02:00