From: Patrick Steinhardt <ps@pks•im>
To: Karthik Nayak <karthik.188@gmail•com>
Cc: git@vger•kernel.org, Jeff King <peff@peff•net>,
Phillip Wood <phillip.wood123@gmail•com>
Subject: Re: [PATCH v2 1/3] t/unit-tests: update clar to 39f11fe
Date: Tue, 6 Jan 2026 12:16:28 +0100 [thread overview]
Message-ID: <aVzvDGVEI2qVJv2F@pks.im> (raw)
In-Reply-To: <CAOLa=ZQZnYVuK8mDi6Yb8_+hqw_TMugn6i7BJCj1gbNHOruNWA@mail.gmail.com>
On Tue, Jan 06, 2026 at 02:59:21AM -0800, Karthik Nayak wrote:
> Patrick Steinhardt <ps@pks•im> writes:
>
> > Update clar to commit 39f11fe (Merge pull request #131 from
> > pks-gitlab/pks-integer-double-evaluation, 2025-12-05). This commit
> > includes the following changes relevant to Git:
> >
>
> Nit: There is a newer commit merged into the clar repository, but I
> don't think it is so important to include.
Yeah, I don't really think it's necessary. If this series needs a reroll
I'll include it, but otherwise I'll keep this series as-is.
> > @@ -149,6 +150,7 @@ const char *cl_fixture_basename(const char *fixture_name);
> > * Forced failure/warning
> > */
> > #define cl_fail(desc) clar__fail(CLAR_CURRENT_FILE, CLAR_CURRENT_FUNC, CLAR_CURRENT_LINE, "Test failed.", desc, 1)
> > +#define cl_failf(desc,...) clar__failf(CLAR_CURRENT_FILE, CLAR_CURRENT_FUNC, CLAR_CURRENT_LINE, 1, "Test failed.", desc, __VA_ARGS__)
>
> Nit: While most of the function accept description with variable
> arguments, this is the only one which has the '...f()' format explicitly
> separated out. It would be nicer if we simply make this part of
> 'cl_fail()', no?
The problem is that we cannot do so easily. Varargs require at least one
argument to be present, so we cannot make this `cl_fail(desc, ...)`
without breaking the case where there are no variable arguments:
In file included from ../t/unit-tests/clar/clar.c:1053:
../t/unit-tests/clar/clar/fs.h:460:3: error: expected expression
460 | cl_fail("Cannot copy; cannot stat destination");
| ^
../t/unit-tests/clar/clar.h:152:132: note: expanded from macro 'cl_fail'
152 | #define cl_fail(desc,...) clar__failf(CLAR_CURRENT_FILE, CLAR_CURRENT_FUNC, CLAR_CURRENT_LINE, 1, "Test failed.", desc, __VA_ARGS__)
| ^
The alternative would be to make this `cl_fail(...)` instead, but to the
best of my knowledge this isn't even a valid construct.
Patrick
next prev parent reply other threads:[~2026-01-06 11:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-05 12:57 [PATCH 0/2] Update clar for improved integer handling Patrick Steinhardt
2025-12-05 12:57 ` [PATCH 1/2] t/unit-tests: update clar to 39f11fe Patrick Steinhardt
2025-12-05 18:40 ` Jeff King
2025-12-06 11:39 ` Patrick Steinhardt
2025-12-06 5:27 ` Junio C Hamano
2025-12-06 11:46 ` Patrick Steinhardt
2025-12-05 12:57 ` [PATCH 2/2] t/unit-tests: demonstrate use of integer comparison assertions Patrick Steinhardt
2025-12-06 11:47 ` [PATCH v2 0/3] Update clar for improved integer handling Patrick Steinhardt
2025-12-06 11:47 ` [PATCH v2 1/3] t/unit-tests: update clar to 39f11fe Patrick Steinhardt
2026-01-06 10:59 ` Karthik Nayak
2026-01-06 11:16 ` Patrick Steinhardt [this message]
2026-01-06 16:28 ` Karthik Nayak
2026-01-07 7:40 ` Jeff King
2026-01-08 12:46 ` Junio C Hamano
2025-12-06 11:47 ` [PATCH v2 2/3] t/unit-tests: demonstrate use of integer comparison assertions Patrick Steinhardt
2025-12-06 11:47 ` [PATCH v2 3/3] gitattributes: disable blank-at-eof errors for clar test expectations Patrick Steinhardt
2026-01-06 11:01 ` [PATCH v2 0/3] Update clar for improved integer handling Karthik Nayak
2026-01-06 11:16 ` Patrick Steinhardt
2026-01-07 3:53 ` Junio C Hamano
2026-01-07 7:01 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aVzvDGVEI2qVJv2F@pks.im \
--to=ps@pks$(echo .)im \
--cc=git@vger$(echo .)kernel.org \
--cc=karthik.188@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
--cc=phillip.wood123@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox