Skip to content

fix clang with c++_static#7477

Merged
waruqi merged 1 commit intodevfrom
clang
Apr 11, 2026
Merged

fix clang with c++_static#7477
waruqi merged 1 commit intodevfrom
clang

Conversation

@waruqi
Copy link
Copy Markdown
Member

@waruqi waruqi commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Clang tool module to remove a redundant assignment to the c++_static map when a static runtime is used. A review comment suggests refining the conditional check to specifically target stdc++_static, which would improve precision and provide better safety against null values.

@@ -285,7 +285,6 @@ function nf_runtime(self, runtime, opt)
end
end
if runtime:endswith("_static") and _has_static_libstdcxx(self) then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The condition runtime:endswith("_static") matches both c++_static and stdc++_static. Since the logic inside this block now only updates maps["stdc++_static"], it is more precise to check for runtime == "stdc++_static". This avoids unnecessary calls to _has_static_libstdcxx(self) (which may involve compiler flag detection) when runtime is c++_static. Additionally, using == is safer as it prevents a potential crash if runtime is nil, whereas endswith would throw an error.

                if runtime == "stdc++_static" and _has_static_libstdcxx(self) then

@waruqi waruqi merged commit 151d094 into dev Apr 11, 2026
73 of 74 checks passed
@waruqi waruqi deleted the clang branch April 11, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant