git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Change] Git build issue on NonStop

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 18, 2025, 13:00 UTC
Message-ID
<aMwCcw-6l1x85Wz-@pks.im>
In-Reply-To
<20250918063152.GA1168297@coredump.intra.peff.net>
On Thu, Sep 18, 2025 at 02:31:52AM -0400, Jeff King wrote:
Show 34 quoted lines
> On Thu, Sep 18, 2025 at 07:37:34AM +0200, Patrick Steinhardt wrote:
> 
> > > >diff --git a/t/unit-tests/clar/clar.c b/t/unit-tests/clar/clar.c index
> > > >80c5359425..f408af850f 100644
> > > >--- a/t/unit-tests/clar/clar.c
> > > >+++ b/t/unit-tests/clar/clar.c
> > > >@@ -875,8 +875,8 @@ void clar__assert_equal(
> > > > 		void *p1 = va_arg(args, void *), *p2 = va_arg(args, void *);
> > > > 		is_equal = (p1 == p2);
> > > > 		if (!is_equal)
> > > >-			p_snprintf(buf, sizeof(buf), "0x%"PRIxPTR" !=
> > > >0x%"PRIxPTR,
> > > >-				   (uintptr_t)p1, (uintptr_t)p2);
> > > >+			p_snprintf(buf, sizeof(buf), "0x%"PRIuMAX" !=
> > > >0x%"PRIuMAX,
> > > >+				   (uintmax_t)p1, (uintmax_t)p2);
> > > > 	}
> > > > 	else {
> > > > 		int i1 = va_arg(args, int), i2 = va_arg(args, int);
> > > >
> > > >would be sufficient.
> > > 
> > > Yes, it would work. uintmax_t is part of the standard set while uintptr_t is
> > > considered an extension. Not my decision on this grouping. I'm setting
> > > the -D in CFLAGS to see if that works, I would be fine going that way, 
> > > although better would be adding it into config.uname.mak in the NONSTOP
> > > section.
> > 
> > That should work alright, yeah. Peff, do you want to create a PR in
> > https://github.com/clar-test/clar to fix this? Otherwise I can handle
> > this.
> 
> I'd be happy if you take it from here. Note in what I posted above it
> should probably be PRIxMAX to show hex (not "u").
One thing I missed: `uintmax_t` doesn't work on 32 bit systems:
    ::error file=clar.c,line=879::clar.c:879:8: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      879 |        (uintmax_t)p1, (uintmax_t)p2);
          |        ^

I'm inclined to just use "%p" instead and accept that this has platform-dependent behaviour. Means we'll have to drop the test for this, but that's the lesser evil from my point of view.

Patrick
Previous: Jeff KingNext: Junio C Hamano
Message 6 of 8 in “[Change] Git build issue on NonStop”
  1. rsbecker@nexbridge.comSep 18, 2025
  2. Jeff KingSep 18, 2025
  3. rsbecker@nexbridge.comSep 18, 2025
  4. Patrick SteinhardtSep 18, 2025
  5. Jeff KingSep 18, 2025
  6. Patrick SteinhardtSep 18, 2025
  7. Junio C HamanoSep 18, 2025
  8. rsbecker@nexbridge.comSep 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.