-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: drop explicit curlx from hdr paths, refer headers with curlx/
prefix
#17680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curlx/
prefix.curlx/
prefix.
curlx/
prefix.curlx/
prefix
fcd5cd4
to
c234533
Compare
Noting that the clang-tidy oddities seen earlier are still here to see:
clang-tidy is saying: llvm/llvm-project#67550 edit: This was fixed by making sure that each test C files compile as individual units, then refactoring clang-tidy for tests, by doing it manually per-file, instead of running it on the bundle C files via the CMake built-in clang-tidy facility. → #17703 #17705 |
vszakats
added a commit
that referenced
this pull request
Jun 21, 2025
Skip clang-tidy while compiling curlu and curltool internal libraries. To save about 1 minute per run. These libraries compile the lib and src sources a second time, with the `UNITTESTS` macro enabled, which makes tiny difference, for internal use. I figure it's not worth the extra CI (and local) time because finding extra issues in these passes is unlikely, and if found, not critical. autotools also doesn't check curlu and curltool with clang-tidy. Ref: #17680 (comment) Ref: https://stackoverflow.com/questions/61867616/ignore-certain-files-when-using-clang-tidy Ref: https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html Follow-up to fabfa8e #15825 Closes #17693
c234533
to
a95e313
Compare
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
Skip clang-tidy while compiling curlu and curltool internal libraries. To save about 1 minute per run. These libraries compile the lib and src sources a second time, with the `UNITTESTS` macro enabled, which makes tiny difference, for internal use. I figure it's not worth the extra CI (and local) time because finding extra issues in these passes is unlikely, and if found, not critical. autotools also doesn't check curlu and curltool with clang-tidy. Ref: curl#17680 (comment) Ref: https://stackoverflow.com/questions/61867616/ignore-certain-files-when-using-clang-tidy Ref: https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html Follow-up to fabfa8e curl#15825 Closes curl#17693
vszakats
added a commit
that referenced
this pull request
Jun 22, 2025
Tidy up headers and includes to ensure all individual test source compile cleanly (but not link). To allow running clang-tidy (and possibly other static analyzers) on them. It also improves readability and allows to verify them locally, without the bundle logic. clang-tidy ignores #included C files, so it's blind to bundle C files the include these tests. The current workaround of embedding has a couple of downsides:. meaningless filenames and line numbers, missing issues, messing up self header paths. Thus, running it on individual sources would be beneficial. Also: - de-duplicate includes. - untangle some includes. - formatting/indentation fixes. - merge `getpart.h` into `first.h`. Ref: #17680 (comment) Closes #17703
vszakats
added a commit
that referenced
this pull request
Jun 22, 2025
Replace existing `mk-unity.pl` `--embed` workaround with running `clang-tidy` manually on individual test source instead. This aligns with how clang-tidy works and removes `mk-unity.pl` from the solution. Also: - mqttd: fix potentially uninitialized buffer by zero filling it. ``` tests/server/mqttd.c:484:41: error: The left operand of '<<' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors] 484 | payload_len = (size_t)(buffer[10] << 8) | buffer[11]; | ^ [...] tests/server/mqttd.c:606:45: error: The left operand of '<<' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors] 606 | topiclen = (size_t)(buffer[1 + bytes] << 8) | buffer[2 + bytes]; | ^ ``` - sockfilt: fix potential out-of-bound pointer: ``` tests/server/sockfilt.c:1128:33: error: The 2nd argument to 'send' is a buffer with size 17010 but should be a buffer with size equal to or greater than the value of the 3rd argument (which is 18446744073709551615) [clang-analyzer-unix.StdCLibraryFunctions,-warnings-as-errors] 1128 | ssize_t bytes_written = swrite(sockfd, buffer, buffer_len); | ^ ``` - clang-tidy: suppress bogus `bzero()` warnings that happens inside the notorious `FD_ZERO()` macros, on macOS. Ref: #17680 (comment) Closes #17705
564c606
to
2ae78e0
Compare
curlx/
prefixcurlx/
prefix
formatting
unit1323: fixup
It's been used in 33 sources out of 42, and timeval.h for all sources.
6748564
to
5f4748b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To make all src and test code refer to curlx headers the same way.
Also:
curlx.h
include totool_setup.h
.curlx/timeval.h
.curlx.h
andcurl_setup.h
includes.<curlx/curlx.h>
.curlx.h
with<>
instead of""
. To matchother parts of the codebase.
I'm thinking that hack is weird enough to drop completely and wait
for clang-tidy to offer an option to look into included C sources.
The embedding changes the implicit header path in case of curlx sources.
Another downside of the embed hack is that the original filenames
are not visible, only the umberalla file (e.g.
clients.c
) is.https://clang.llvm.org/extra/clang-tidy/
RESOLVED via tests: make individual test sources compile cleanly #17703 cmake: replace the way clang-tidy verifies tests, fix issues found #17705
https://github.com/curl/curl/actions/runs/15774892957/job/44467063782?pr=17680#step:14:250