#
e512fbfa |
| 22-Aug-2024 |
Viktor Szakats |
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
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: c730c8549b5b67e7668ca5d2cd82c3cc183e125d #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 3829759bd042c03225ae862062560f568ba1a231 #12489 Closes #14703
show more ...
|
#
8b091380 |
| 19-Aug-2024 |
Viktor Szakats |
cmake: minor tidy-ups - show `OpenSSL v3+` when detected (as in `./configure`). (this string also makes its way to `curl-config`.) - prefer `unset(VAR)` over `set(VAR)`. Same
cmake: minor tidy-ups - show `OpenSSL v3+` when detected (as in `./configure`). (this string also makes its way to `curl-config`.) - prefer `unset(VAR)` over `set(VAR)`. Same effect, but `unset()` tells the intent unambiguously. https://cmake.org/cmake/help/latest/command/set.html - drop "implementation" from an `option()` description. - FindGSS: replace legacy keyword alias with modern alternative. https://cmake.org/cmake/help/latest/command/get_filename_component.html - move `CURL_STATIC_CRT` logic next to its `option()`. - improve order of `libcurl.pc`/`curl-config` variable init lines. - tests: drop/shorten custom target names. They inflated generated make files by 550KB. Keep target name logic for sync between code snippets. Follow-up to a2ef5d36b3cdec8120a4a9b782d18d58a70d4236 #14660 - clear a variable after use. - restore `STATUS` for `Features:`/`Protocols:` `message()`s: Without it the output goes to stderr, and appears in red in CMake GUI. It doesn't seem possible to show a line on stdout without leading underscores to match `curl -V` and `./configure` output. Partial revert of acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197 - WindowsCache: move `HAVE_LINUX_TCP_H` into the header group. - move strings to the same line as their `STRING` keyword. - formatting in generated code. - delete bogus comment. - unfold lines for readability. - fix a too long line. (for cmakelint) - missing quotes, whitespace, comments. Closes #14610
show more ...
|
#
a2ef5d36 |
| 22-Aug-2024 |
Viktor Szakats |
cmake: sync code between test/example targets - reuse local variable names. - sync `PROJECT_LABEL`, add where missing. - namespace all target names. - bind header directories to
cmake: sync code between test/example targets - reuse local variable names. - sync `PROJECT_LABEL`, add where missing. - namespace all target names. - bind header directories to each target. - tests/server: limit `CURL_STATICLIB` to Windows (as in autotools.) - drop functions with a single caller. Closes #14660
show more ...
|
#
c730c854 |
| 21-Aug-2024 |
Viktor Szakats |
build: make `CURL_FORMAT_CURL_OFF_T[U]` work with mingw-w64 <=7.0.0 Add tweak for mingw-w64 when building tests/http/client programs to avoid a bogus `-Wformat` warning when using mingw-
build: make `CURL_FORMAT_CURL_OFF_T[U]` work with mingw-w64 <=7.0.0 Add tweak for mingw-w64 when building tests/http/client programs to avoid a bogus `-Wformat` warning when using mingw-w64 v7.0.0 or older. The warning is bogus because these programs use curl's `printf()` implementation that is guaranteed to support that format spec. Add this for both CMake and autotools. (But only CMake is CI tested with an old toolchain.) Apply the workaround to `docs/examples`, and fix an example to use curl's `printf()` with `CURL_FORMAT_CURL_OFF_T`. Reintroduce curl `printf()` calls into `tests/http/client`, via #14625. Also restore large number masks to a printf, changed earlier in #14382. Follow-up to 232302f88a152a1d1722da9f69c383a766528918 #14382 Ref: https://github.com/curl/curl/pull/14625#issuecomment-2302361737 Closes #14640
show more ...
|
#
aa3a31ce |
| 09-Aug-2024 |
Viktor Szakats |
cmake: exclude tests/http/clients builds by default To limit building them with the testdeps target, like it's done with the rest of test programs. Follow-up to 232302f88a152a1d
cmake: exclude tests/http/clients builds by default To limit building them with the testdeps target, like it's done with the rest of test programs. Follow-up to 232302f88a152a1d1722da9f69c383a766528918 #14382 Closes #14477
show more ...
|
#
c2889a7b |
| 04-Aug-2024 |
Viktor Szakats |
cmake: more syntax tidy-up - quote string literals. In the hope it improves syntax-highlighting and readability. - use lowercase, underscore-prefixed local var names. As
cmake: more syntax tidy-up - quote string literals. In the hope it improves syntax-highlighting and readability. - use lowercase, underscore-prefixed local var names. As a hint for scope, to help readability. - prefer `pkg_search_module` (over `pkg_check_modules`). They are the same, but `pkg_search_module` stops searching at the first hit. - more `IN LISTS` in `foreach()`. - OtherTests.cmake: clear `CMAKE_EXTRA_INCLUDE_FILES` after use. - add `PROJECT_LABEL` for http/client and unit test targets. - sync `Find*` module comments and formatting. - drop a few local variables. - drop bogus `CARES_LIBRARIES` from comment. - unquote numeric literal. Follow-up to acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197 Closes #14388
show more ...
|
#
c6fb9895 |
| 06-Aug-2024 |
Viktor Szakats |
cmake: cleanup header paths - sync build-dir/source-dir header path order with autotools, by including build-dir first, then source-dir. This prevents out-of-tree builds breaking
cmake: cleanup header paths - sync build-dir/source-dir header path order with autotools, by including build-dir first, then source-dir. This prevents out-of-tree builds breaking due to leftover generated headers in the source tree. - tests/unit: move `src` ahead of `libtest` in header path, syncing with autotools. - stop adding non-existing generated `include` dir to header path. There are no generated `include` headers and this directory is either missing in out-of-tree builds or the same as the one already added globally via the root `CMakeLists.txt`. - lib: stop adding a duplicate source include directory to the header path. It's already added globally via the root `CMakeLists.txt`. - lib: stop adding the project root to the header path. - docs/examples: drop internal header paths. Examples do not and should not use internal headers. - replace `curl_setup_once.h` in comments with `curl_setup.h`, the header actually used, and also referred to in autotools comments. - add comment why we need `src` in include path for `tests/server`. - add quotes around header directories. Closes #14416
show more ...
|
#
232302f8 |
| 04-Aug-2024 |
Viktor Szakats |
cmake: add Linux CI job, fix pytest with cmake - extend existing Linux workflow with CMake support. Including running pytest the first time with CMake. - cmake: generate `test
cmake: add Linux CI job, fix pytest with cmake - extend existing Linux workflow with CMake support. Including running pytest the first time with CMake. - cmake: generate `tests/config` and `tests/http/config.ini`. Required for pytest tests. Uses basic detection logic. Feel free to take it from here. Also dump config files in a CI step for debugging purposes. - cmake: build `tests/http/clients` programs. - fix portability issues with `tests/http/clients` programs. Some of them use `getopt()`, which is not supported by MSVC. Fix the rest to compile in CI (old-mingw-w64, MSVC, Windows). - GHA/linux: add CMake job matching an existing autotools one. - GHA/linux: test `-DCURL_LIBCURL_VERSIONED_SYMBOLS=ON` in the new CMake job. - reorder testdeps to build server, client tests first and then libtests and units, to catch errors in the more complex/unique sources earlier. - sort list in `tests/http/clients/Makefile.inc`. Closes #14382
show more ...
|