-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: errors found by -Werror on Clang 20 #18877
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
Conversation
|
Updated 12:43 PM PT - Apr 9th, 2025
❌ @DonIsaac, your commit eaeb798 has 2 failures in
🧪 try this PR locally: bunx bun-pr 18877 |
| auto view = WTF::StringView(function->name()); | ||
| String name = function->name(); | ||
| auto view = WTF::StringView(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, what was the error message here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringView using a String that was created but immediately thrown away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, but it's also dubious that we pass it to toZigString right after since that uses the same pointer. What I'm wondering is if the function owns name() (this seems likely, but I haven't investigated fully) or if it's making a new string when we call it.
If it's owned by the function, then this is fine, but if it's a new string then even the changed code is still broken.
What does this PR do?
-Werrorviolations found by clang v20bun.assertfHow did you verify your code works?
If it compiles, it works