Re: [PATCH 0/2] Avoid the comma operator
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 26, 2025, 17:29 UTC
- Message-ID
- <Z+Q5cWAHxxNm8BhK@nand.local>
- In-Reply-To
- <ea6bfd92-3d09-c611-abdc-dc7bc987446f@gmx.de>
On Tue, Mar 25, 2025 at 03:12:21PM +0100, Johannes Schindelin wrote:
Show 16 quoted lines
> Hi Philip, > > On Tue, 25 Mar 2025, Philip Oakley wrote: > > > 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.)
Neat. I will be curious to see how the results compare/contrast to what those of us who run Coverity get.
Thanks, Taylor