# Build Failure: Git 2.50.0-rc0 on NonStop

13 messages from 2025-05-28 to 2025-06-01. Participants: rsbecker@nexbridge.com, Carlo Marcelo Arenas Belón, Junio C Hamano, brian m. carlson, Patrick Steinhardt, Jeff King, Kristoffer Haugsbakk.
Thread: https://gitlist.dev/t/63542

## rsbecker@nexbridge.com, 2025-05-28 18:59

Subject: Build Failure: Git 2.50.0-rc0 on NonStop
Message-ID: <046901dbd002$a0c245c0$e246d140$@nexbridge.com>
URL: https://gitlist.dev/e/046901dbd002%24a0c245c0%24e246d140%24%40nexbridge.com

```
I encountered the following failure of rc0:

static void file_release_data(void *b REFTABLE_UNUSED, struct
reftable_block_data *dest REFTABLE_UNUSED)
                                        ^
"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c",
line 105: error(112):  expected a ")"


I am not at all sure why this is failing at this point. Compiler is c99.


--
Brief whoami: NonStop&UNIX developer since approximately
UNIX(421664400)
NonStop(211288444200000000)
-- In real life, I talk too much.




```

## Carlo Marcelo Arenas Belón, 2025-05-29 10:11

Subject: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <20250529101136.16219-1-carenas@gmail.com>
URL: https://gitlist.dev/e/20250529101136.16219-1-carenas%40gmail.com
In-Reply-To: <046901dbd002$a0c245c0$e246d140$@nexbridge.com>

```
Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
annotation, 2025-02-18), the reftable library was migrated to
use an internal version of `UNUSED`, which unconditionally sets
a GNU __attribute__ to avoid warnings function parameters that
are not being used.

Make the definition conditional to prevent breaking the build
with non GNU compilers.

Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 reftable/basics.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/reftable/basics.h b/reftable/basics.h
index d8888c1262..7d22f96261 100644
--- a/reftable/basics.h
+++ b/reftable/basics.h
@@ -16,7 +16,11 @@
 #include "system.h"
 #include "reftable-basics.h"
 
+#ifdef __GNUC__
 #define REFTABLE_UNUSED __attribute__((__unused__))
+#else
+#define REFTABLE_UNUSED
+#endif
 
 /*
  * Initialize the buffer such that it is ready for use. This is equivalent to
-- 
2.50.0.rc0.1.gb4243b6ac8


```

## Junio C Hamano, 2025-05-29 16:17

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <xmqqtt53l7cl.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqtt53l7cl.fsf%40gitster.g
In-Reply-To: <20250529101136.16219-1-carenas@gmail.com>

```
Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:

> Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
> annotation, 2025-02-18), the reftable library was migrated to
> use an internal version of `UNUSED`, which unconditionally sets
> a GNU __attribute__ to avoid warnings function parameters that
> are not being used.
>
> Make the definition conditional to prevent breaking the build
> with non GNU compilers.

Quite a reasonable reasoning.

> Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  reftable/basics.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/reftable/basics.h b/reftable/basics.h
> index d8888c1262..7d22f96261 100644
> --- a/reftable/basics.h
> +++ b/reftable/basics.h
> @@ -16,7 +16,11 @@
>  #include "system.h"
>  #include "reftable-basics.h"
>  
> +#ifdef __GNUC__
>  #define REFTABLE_UNUSED __attribute__((__unused__))
> +#else
> +#define REFTABLE_UNUSED
> +#endif

Corresponding definition we use in the main part of the project
defined in compat/posix.h looks like this:

        #if GIT_GNUC_PREREQ(4, 5)
        #define UNUSED __attribute__((unused)) \
                __attribute__((deprecated ("parameter declared as UNUSED")))
        #elif defined(__GNUC__)
        #define UNUSED __attribute__((unused)) \
                __attribute__((deprecated))
        #else
        #define UNUSED
        #endif

GCC 4.5 or older may no longer be relevant, in which case yours may
be good enough.

Will queue.  Thanks.

```

## brian m. carlson, 2025-05-29 23:13

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <aDjp_IkgmITrl59-@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/aDjp_IkgmITrl59-%40tapette.crustytoothpaste.net
In-Reply-To: <xmqqtt53l7cl.fsf@gitster.g>

```
On 2025-05-29 at 16:17:14, Junio C Hamano wrote:
> Corresponding definition we use in the main part of the project
> defined in compat/posix.h looks like this:
> 
>         #if GIT_GNUC_PREREQ(4, 5)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated ("parameter declared as UNUSED")))
>         #elif defined(__GNUC__)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated))
>         #else
>         #define UNUSED
>         #endif
> 
> GCC 4.5 or older may no longer be relevant, in which case yours may
> be good enough.

RHEL 7, which is now well past EOL, had GCC 4.8 and Debian 7, released
in 2013 and also well past EOL, had GCC 4.7.  I think we can safely
assume nobody within our support policy is using GCC before 4.5.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

```

## Junio C Hamano, 2025-05-30 04:12

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <xmqq7c1yivne.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq7c1yivne.fsf%40gitster.g
In-Reply-To: <aDjp_IkgmITrl59-@tapette.crustytoothpaste.net>

```
"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> On 2025-05-29 at 16:17:14, Junio C Hamano wrote:
>> Corresponding definition we use in the main part of the project
>> defined in compat/posix.h looks like this:
>> 
>>         #if GIT_GNUC_PREREQ(4, 5)
>>         #define UNUSED __attribute__((unused)) \
>>                 __attribute__((deprecated ("parameter declared as UNUSED")))
>>         #elif defined(__GNUC__)
>>         #define UNUSED __attribute__((unused)) \
>>                 __attribute__((deprecated))
>>         #else
>>         #define UNUSED
>>         #endif
>> 
>> GCC 4.5 or older may no longer be relevant, in which case yours may
>> be good enough.
>
> RHEL 7, which is now well past EOL, had GCC 4.8 and Debian 7, released
> in 2013 and also well past EOL, had GCC 4.7.  I think we can safely
> assume nobody within our support policy is using GCC before 4.5.

Good digging.  There is another one in git-compat-util.h that
is conditional on GIT_GNUC_PREREQ(3,1) which we can simplify away to
just "#ifdef __GNUC__", together with the above.  Of course totally
outside of Carlo's fix to the reftable library.

Thanks.

```

## Patrick Steinhardt, 2025-05-30 05:35

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <aDlDtbUcX5NA8wCK@pks.im>
URL: https://gitlist.dev/e/aDlDtbUcX5NA8wCK%40pks.im
In-Reply-To: <xmqqtt53l7cl.fsf@gitster.g>

```
On Thu, May 29, 2025 at 09:17:14AM -0700, Junio C Hamano wrote:
> Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
> 
> > Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
> > annotation, 2025-02-18), the reftable library was migrated to
> > use an internal version of `UNUSED`, which unconditionally sets
> > a GNU __attribute__ to avoid warnings function parameters that
> > are not being used.
> >
> > Make the definition conditional to prevent breaking the build
> > with non GNU compilers.
> 
> Quite a reasonable reasoning.
> 
> > Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
> > Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> > ---
> >  reftable/basics.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/reftable/basics.h b/reftable/basics.h
> > index d8888c1262..7d22f96261 100644
> > --- a/reftable/basics.h
> > +++ b/reftable/basics.h
> > @@ -16,7 +16,11 @@
> >  #include "system.h"
> >  #include "reftable-basics.h"
> >  
> > +#ifdef __GNUC__
> >  #define REFTABLE_UNUSED __attribute__((__unused__))
> > +#else
> > +#define REFTABLE_UNUSED
> > +#endif
> 
> Corresponding definition we use in the main part of the project
> defined in compat/posix.h looks like this:
> 
>         #if GIT_GNUC_PREREQ(4, 5)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated ("parameter declared as UNUSED")))
>         #elif defined(__GNUC__)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated))
>         #else
>         #define UNUSED
>         #endif
> 
> GCC 4.5 or older may no longer be relevant, in which case yours may
> be good enough.

What I don't understand though: we have a `MAYBE_UNUSED` macro that has
the exact same definition in "git-compat-util.h". Why does the macro
cause issues in the reftable library, but not over there?

Patrick

```

## Jeff King, 2025-05-30 06:25

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <20250530062533.GA1321283@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20250530062533.GA1321283%40coredump.intra.peff.net
In-Reply-To: <aDlDtbUcX5NA8wCK@pks.im>

```
On Fri, May 30, 2025 at 07:35:49AM +0200, Patrick Steinhardt wrote:

> What I don't understand though: we have a `MAYBE_UNUSED` macro that has
> the exact same definition in "git-compat-util.h". Why does the macro
> cause issues in the reftable library, but not over there?

We turn __attribute__() into a noop for some platforms earlier in
git-compat-util.h. So it doesn't need a separate #ifdef.

-Peff

```

## Patrick Steinhardt, 2025-05-30 08:47

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <aDlwsM_18nYB2MOr@pks.im>
URL: https://gitlist.dev/e/aDlwsM_18nYB2MOr%40pks.im
In-Reply-To: <20250530062533.GA1321283@coredump.intra.peff.net>

```
On Fri, May 30, 2025 at 02:25:33AM -0400, Jeff King wrote:
> On Fri, May 30, 2025 at 07:35:49AM +0200, Patrick Steinhardt wrote:
> 
> > What I don't understand though: we have a `MAYBE_UNUSED` macro that has
> > the exact same definition in "git-compat-util.h". Why does the macro
> > cause issues in the reftable library, but not over there?
> 
> We turn __attribute__() into a noop for some platforms earlier in
> git-compat-util.h. So it doesn't need a separate #ifdef.

Ah, that's something I missed when introducing `REFTABLE_UNUSED`.
With that added context the patch looks sensible to me. Thanks!

Patrick

```

## rsbecker@nexbridge.com, 2025-05-30 12:04

Subject: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
Message-ID: <055d01dbd15b$14d4c880$3e7e5980$@nexbridge.com>
URL: https://gitlist.dev/e/055d01dbd15b%2414d4c880%243e7e5980%24%40nexbridge.com
In-Reply-To: <046901dbd002$a0c245c0$e246d140$@nexbridge.com>

```
On May 28, 2025 2:59 PM, I wrote:
>To: git@vger.kernel.org
>I encountered the following failure of rc0:
>
>static void file_release_data(void *b REFTABLE_UNUSED, struct
>reftable_block_data *dest REFTABLE_UNUSED)
>                                        ^
>"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c"
,
>line 105: error(112):  expected a ")"
>
>
>I am not at all sure why this is failing at this point. Compiler is c99.

Looking for help on resolving this before rc1.

Sincerely,
Randall


```

## Kristoffer Haugsbakk, 2025-05-30 14:19

Subject: Re: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
Message-ID: <51425125-0a50-4b03-bcc3-da3942c88b06@app.fastmail.com>
URL: https://gitlist.dev/e/51425125-0a50-4b03-bcc3-da3942c88b06%40app.fastmail.com
In-Reply-To: <055d01dbd15b$14d4c880$3e7e5980$@nexbridge.com>

```
On Fri, May 30, 2025, at 14:04, rsbecker@nexbridge.com wrote:
>> [snip]
>>I am not at all sure why this is failing at this point. Compiler is c99.
>
> Looking for help on resolving this before rc1.

Patch: https://lore.kernel.org/git/20250529101136.16219-1-carenas@gmail.com/

```

## Patrick Steinhardt, 2025-05-30 14:26

Subject: Re: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
Message-ID: <aDnAGra6dsfubSHF@pks.im>
URL: https://gitlist.dev/e/aDnAGra6dsfubSHF%40pks.im
In-Reply-To: <055d01dbd15b$14d4c880$3e7e5980$@nexbridge.com>

```
On Fri, May 30, 2025 at 08:04:47AM -0400, rsbecker@nexbridge.com wrote:
> On May 28, 2025 2:59 PM, I wrote:
> >To: git@vger.kernel.org
> >I encountered the following failure of rc0:
> >
> >static void file_release_data(void *b REFTABLE_UNUSED, struct
> >reftable_block_data *dest REFTABLE_UNUSED)
> >                                        ^
> >"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c"
> ,
> >line 105: error(112):  expected a ")"
> >
> >
> >I am not at all sure why this is failing at this point. Compiler is c99.
> 
> Looking for help on resolving this before rc1.

Did you maybe miss the proposed patch at [1]? That should fix your
issue.

Patrick

[1]: <20250529101136.16219-1-carenas@gmail.com>

```

## Junio C Hamano, 2025-05-30 16:28

Subject: Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
Message-ID: <xmqqsekmf4fw.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqsekmf4fw.fsf%40gitster.g
In-Reply-To: <aDlwsM_18nYB2MOr@pks.im>

```
Patrick Steinhardt <ps@pks.im> writes:

> Ah, that's something I missed when introducing `REFTABLE_UNUSED`.
> With that added context the patch looks sensible to me. Thanks!

OK, let's fast-track the fix down to 'master' before '-rc1', then.

Thanks, all.

```

## rsbecker@nexbridge.com, 2025-06-01 09:36

Subject: RE: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
Message-ID: <061401dbd2d8$b4ba03a0$1e2e0ae0$@nexbridge.com>
URL: https://gitlist.dev/e/061401dbd2d8%24b4ba03a0%241e2e0ae0%24%40nexbridge.com
In-Reply-To: <aDnAGra6dsfubSHF@pks.im>

```
On May 30, 2025 10:27 AM, Patrick Steinhardt wrote:
>On Fri, May 30, 2025 at 08:04:47AM -0400, rsbecker@nexbridge.com wrote:
>> On May 28, 2025 2:59 PM, I wrote:
>> >To: git@vger.kernel.org
>> >I encountered the following failure of rc0:
>> >
>> >static void file_release_data(void *b REFTABLE_UNUSED, struct
>> >reftable_block_data *dest REFTABLE_UNUSED)
>> >                                        ^
>>
>"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c"
>> ,
>> >line 105: error(112):  expected a ")"
>> >
>> >
>> >I am not at all sure why this is failing at this point. Compiler is c99.
>>
>> Looking for help on resolving this before rc1.
>
>Did you maybe miss the proposed patch at [1]? That should fix your issue.

Thanks Patrick. As a packager, I can only build using merged fixes for
2.25.0-rc*. I'm hoping this
makes rc1


```
