Viktor Szakats
afa6b86560
build: enable missing OpenSSF-recommended warnings, with fixes
...
Ref:
https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html
(2023-11-29)
Enable new warnings:
- replace `-Wno-sign-conversion` with `-Wsign-conversion`.
Fix them in example, tests and wincng. There remain about 360 of these
warnings in `src`. Add a TODO item for those and disable `-Werror` for
this particular warning.
- enable `-Wformat=2` for clang (in both cmake and autotools).
- enable `__attribute__((format))` for `_libssh2_debug()`,
`_libssh2_snprintf()` and in tests for `run_command()`.
`LIBSSH2_PRINTF()` copied from `CURL_TEMP_PRINTF()` in curl.
- enable `-Wimplicit-fallthrough`.
- enable `-Wtrampolines`.
Fix them:
- src: replace obsolete fall-through-comments with
`__attribute__((fallthrough))`.
- wincng: fix `-Wsign-conversion` warnings.
- tests: fix `-Wsign-conversion` warnings.
- example: fix `-Wsign-conversion` warnings.
- src: fix `-Wformat` issues in trace calls.
Also, where necessary fix `int` and `unsigned char` casts to
`unsigned int` and adjust printf format strings. These were not
causing compiler warnings.
Cast large types to `long` to avoid dealing with printf masks for
`size_t` and other C99 types. Existing code often used `int` for this.
I'll update them to `long` in an upcoming commit.
- tests: fix `-Wformat` warning.
- silence `-Wformat-nonliteral` warnings.
- mbedtls: silence `-Wsign-conversion`/`-Warith-conversion`
in external header.
Closes #1257
2023-12-03 01:32:20 +00:00
..
2023-04-10 09:20:13 +00:00
2023-05-29 17:07:11 +00:00
2023-04-10 23:03:43 +00:00
2023-08-15 15:08:30 +00:00
2023-11-06 21:41:12 +00:00
2023-04-10 23:03:43 +00:00
2023-06-21 17:43:42 +00:00
2023-08-15 21:58:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-12-02 09:53:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-11-03 19:57:56 +00:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-04-22 10:54:20 +02:00
2023-08-18 11:20:58 +00:00
2023-04-26 17:55:51 +00:00
2023-12-03 01:32:20 +00:00