Re: [PATCH 0/2] Avoid the comma operator
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 25, 2025, 14:12 UTC
- Message-ID
- <ea6bfd92-3d09-c611-abdc-dc7bc987446f@gmx.de>
- In-Reply-To
- <f30d8ac4-4748-4b73-b86d-6f85c9bac622@iee.email>
Hi Philip,
On Tue, 25 Mar 2025, Philip Oakley wrote:
Show 8 quoted lines
> On 25/03/2025 08:01, Johannes Schindelin via GitGitGadget wrote: > > The comma operator > > [https://en.cppreference.com/w/c/language/operator_other#Comma_operator] is > > rarely used in C anymore, and typically indicates a typo. Just like in these > > instances, where a semicolon was meant to be used, as there is no need to > > discard the first statement's result here. > > Minor aside: How were these 'discovered'?
I am working on a GitHub workflow that uses CodeQL to find such issues, that's how I found them. (I also worked with the CodeQL team to get this query added, way back when I was still working at GitHub.)
Ciao, Johannes