{"author":"Viktor Szakats","author_email":"commit@vsz.me","author_time":1735004582,"commit_time":1735303352,"committer":"Viktor Szakats","committer_email":"commit@vsz.me","hash":"fabfa8e4024473035b3e5c3c30c330be726d9bb4","message":"clang-tidy: add to CI, add cmake support, fix fallouts\n\nbuild:\n- autotools: fix to build generated sources for the `tidy` target.\n- autotools: allow passing custom clang-tidy options via\n  `CURL_CLANG_TIDYFLAGS` env.\n- cmake: add `CURL_CLANG_TIDY` option to configure for `clang-tidy`.\n  Also add:\n  - `CLANG_TIDY` variable to customize the `clang-tidy` tool.\n  - `CURL_CLANG_TIDYFLAGS` to pass custom options to `clang-tidy`.\n- apply `--enable-werror` and `-DCURL_WERROR=ON` to `clang-tidy`.\n\nCI/GHA:\n- add clang-tidy job for Linux, using autotools and clang-tidy v18.\n  This one needs to disable `clang-analyzer-valist.Uninitialized`\n  to avoid false positives:\n  https://github.com/llvm/llvm-project/issues/40656\n  Duration: 5.5 minutes\n- add clang-tidy job for macOS, using cmake and clang-tidy v19.\n  This one also covers tests and examples, and doesn't hit the false\n  positives seen with llvm v18 and earlier.\n  Duration: 4.5 minutes\n- Linux/macOS: skip installing test dependencies when not building or\n  running tests.\n\nfix fallouts reported by `clang-tidy`:\n- lib:\n  - cf-h2-proxy: unused assignment in non-debug builds.\n  - cf-socket: silence warning.\n    FIXME: https://github.com/curl/curl/pull/15825#issuecomment-2561867769\n  - ftp: NULL passed to `strncmp()`.\n  - http2: NULL-ptr deref.\n  - mprintf: silence warning.\n- src/tool_writeout: NULL passed to `fputs()`.\n- examples:\n  - invalid file pointers.\n  - missing `fclose()`.\n- tests:\n  - http/clients/hx-download: memory leaks on error.\n  - http/clients/hx-download: memory leak on repeat `-r` option.\n  - server: double `fclose()`.\n    https://www.man7.org/linux/man-pages/man3/fclose.3.html\n  - server: invalid file pointer/handle.\n  - server/getpart: unused assignments.\n  - server/mqttd: leak on failed `realloc()`.\n  - server/tftpd: NULL passed to `strcmp()`.\n\nCloses #15825\n","parents":["421e592db25cbbe4baadfeef8e6ed75a57579d0a"],"tree_hash":"c953b994316c7a2a1be1b9f7cccf3aa561a13112"}