Skip to content
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

Silence warning on comma misuse #13392

Closed
wants to merge 2 commits into from

Conversation

MonkeybreadSoftware
Copy link
Contributor

Building curl with -Wcomma, I see warnings about "possible misuse of comma operator here" and moving fields assignment out of the for() fixes it.

Building curl with -Wcomma, I see warnings about "possible misuse of comma operator here" and moving fields assignment out of the for() fixes it.
another one
Copy link
Member

@danielgustafsson danielgustafsson left a comment

Choose a reason for hiding this comment

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

LGTM

@danielgustafsson
Copy link
Member

Thanks, I think this is a step towards less clever and more readable code. I'll just let CI have a look before pushing.

@bagder
Copy link
Member

bagder commented Apr 17, 2024

We should probably add -Wcomma to the picky compiler options

@bagder
Copy link
Member

bagder commented Apr 17, 2024

Turns out we already do (with clang)! @MonkeybreadSoftware are you perhaps using a very recent clang with perhaps some changes for this warning?

@MonkeybreadSoftware
Copy link
Contributor Author

Sorry, this is just my test project in Xcode 15.3 to work on curl changes in the IDE.
It has a few warnings enabled like suspicious commas and reported the two source code lines here.

Maybe your CI with Xcode 14 doesn't report this.

@bagder
Copy link
Member

bagder commented Apr 17, 2024

Maybe your CI with Xcode 14 doesn't report this.

This is a clang option added in 3.9 and we build with this option in several builds. Totally independent of xcode. I have no idea why they don't warn on these.

@bagder bagder closed this in 0b4401a Apr 17, 2024
@bagder
Copy link
Member

bagder commented Apr 17, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants