mk-unity.pl: #include, and not concatenate input headers#21656
Closed
vszakats wants to merge 2 commits into
Closed
mk-unity.pl: #include, and not concatenate input headers#21656vszakats wants to merge 2 commits into
#include, and not concatenate input headers#21656vszakats wants to merge 2 commits into
Conversation
When using `-D_CURL_TESTS_CONCAT=ON` with CMake, do not concatenate `first.h` (or any future header) into the output C file, but `#include` it instead. This is it play nice with compilers and analyzers which may apply different checker rules on logic found in headers, vs. the input source file. As seen for example with `-Wunused-macro`. After this patch the concatenated source behaves closer to a regular C source. Follow-up to 47f411c curl#21554
#include instead
#include instead#include, and not concatenate input headers
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
When using `-D_CURL_TESTS_CONCAT=ON` with CMake, do not concatenate `first.h` (or any future header) into the output C file, but `#include` it instead. This is to play nice with compilers and analyzers which may apply different checker rules on logic found in headers, vs. the input source file. As seen for example with `-Wunused-macro` enabled in CI. After this patch concatenated sources behave closer to regular C sources. Also: - first.h: drop some `-Wunused-macro` silencers that became redundant with this patch. Follow-up to 47f411c curl#21554 Follow-up to 39542f0 curl#20667 Closes curl#21656
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
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.
When using
-D_CURL_TESTS_CONCAT=ONwith CMake, do not concatenatefirst.h(or any future header) into the output C file, but#includeit instead. This is to play nice with compilers and analyzers which may
apply different checker rules on logic found in headers, vs. the input
source file. As seen for example with
-Wunused-macroenabled in CI.After this patch concatenated sources behave closer to regular C
sources.
Also:
-Wunused-macrosilencers that became redundantwith this patch.
Follow-up to 47f411c #21554
Follow-up to 39542f0 #20667