Re: [PATCH v2 07/10] wildmatch: explicitly mark intentional use of the comma operator
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 26, 2025, 05:54 UTC
- Message-ID
- <Z-OWpEDwHtaq3r2J@pks.im>
- In-Reply-To
- <9a6de12b8076266fb0c88f6b658c20d37409ce13.1742945534.git.gitgitgadget@gmail.com>
On Tue, Mar 25, 2025 at 11:32:11PM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 13 quoted lines
> diff --git a/wildmatch.c b/wildmatch.c > index 8ea29141bd7..ce8108a6d57 100644 > --- a/wildmatch.c > +++ b/wildmatch.c > @@ -268,7 +268,7 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags) > p_ch = 0; /* This makes "prev_ch" get set to 0. */ > } else if (t_ch == p_ch) > matched = 1; > - } while (prev_ch = p_ch, (p_ch = *++p) != ']'); > + } while ((void)(prev_ch = p_ch), (p_ch = *++p) != ']'); > if (matched == negated || > ((flags & WM_PATHNAME) && t_ch == '/')) > return WM_NOMATCH;
In this case I agree that it makes sense to not introduce curly braces for brevity.
Patrick