Skip to content

Silence warning on comma misuse - #13392

Closed
MonkeybreadSoftware wants to merge 2 commits into
curl:masterfrom
MonkeybreadSoftware:patch-10
Closed

Silence warning on comma misuse#13392
MonkeybreadSoftware wants to merge 2 commits into
curl:masterfrom
MonkeybreadSoftware:patch-10

Conversation

@MonkeybreadSoftware

Copy link
Copy Markdown
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

@danielgustafsson danielgustafsson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@danielgustafsson

Copy link
Copy Markdown
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

bagder commented Apr 17, 2024

Copy link
Copy Markdown
Member

We should probably add -Wcomma to the picky compiler options

@bagder

bagder commented Apr 17, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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

bagder commented Apr 17, 2024

Copy link
Copy Markdown
Member

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

bagder commented Apr 17, 2024

Copy link
Copy Markdown
Member

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.

3 participants