git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Build Failure: Git 2.50.0-rc0 on NonStop
@ 2025-05-28 18:59 rsbecker
  2025-05-29 10:11 ` [PATCH] reftable: make REFTABLE_UNUSED C99 compatible Carlo Marcelo Arenas Belón
  2025-05-30 12:04 ` [Bug] Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
  0 siblings, 2 replies; 13+ messages in thread
From: rsbecker @ 2025-05-28 18:59 UTC (permalink / raw)
  To: git

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.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-28 18:59 Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
@ 2025-05-29 10:11 ` Carlo Marcelo Arenas Belón
  2025-05-29 16:17   ` Junio C Hamano
  2025-05-30 12:04 ` [Bug] Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
  1 sibling, 1 reply; 13+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2025-05-29 10:11 UTC (permalink / raw)
  To: git; +Cc: ps, Carlo Marcelo Arenas Belón, Randall S. Becker

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-29 10:11 ` [PATCH] reftable: make REFTABLE_UNUSED C99 compatible Carlo Marcelo Arenas Belón
@ 2025-05-29 16:17   ` Junio C Hamano
  2025-05-29 23:13     ` brian m. carlson
  2025-05-30  5:35     ` Patrick Steinhardt
  0 siblings, 2 replies; 13+ messages in thread
From: Junio C Hamano @ 2025-05-29 16:17 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belón; +Cc: git, ps, Randall S. Becker

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-29 16:17   ` Junio C Hamano
@ 2025-05-29 23:13     ` brian m. carlson
  2025-05-30  4:12       ` Junio C Hamano
  2025-05-30  5:35     ` Patrick Steinhardt
  1 sibling, 1 reply; 13+ messages in thread
From: brian m. carlson @ 2025-05-29 23:13 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Carlo Marcelo Arenas Belón, git, ps, Randall S. Becker

[-- Attachment #1: Type: text/plain, Size: 891 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-29 23:13     ` brian m. carlson
@ 2025-05-30  4:12       ` Junio C Hamano
  0 siblings, 0 replies; 13+ messages in thread
From: Junio C Hamano @ 2025-05-30  4:12 UTC (permalink / raw)
  To: brian m. carlson
  Cc: Carlo Marcelo Arenas Belón, git, ps, Randall S. Becker

"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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-29 16:17   ` Junio C Hamano
  2025-05-29 23:13     ` brian m. carlson
@ 2025-05-30  5:35     ` Patrick Steinhardt
  2025-05-30  6:25       ` Jeff King
  1 sibling, 1 reply; 13+ messages in thread
From: Patrick Steinhardt @ 2025-05-30  5:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Carlo Marcelo Arenas Belón, git, Randall S. Becker

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-30  5:35     ` Patrick Steinhardt
@ 2025-05-30  6:25       ` Jeff King
  2025-05-30  8:47         ` Patrick Steinhardt
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff King @ 2025-05-30  6:25 UTC (permalink / raw)
  To: Patrick Steinhardt
  Cc: Junio C Hamano, Carlo Marcelo Arenas Belón, git,
	Randall S. Becker

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-30  6:25       ` Jeff King
@ 2025-05-30  8:47         ` Patrick Steinhardt
  2025-05-30 16:28           ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Patrick Steinhardt @ 2025-05-30  8:47 UTC (permalink / raw)
  To: Jeff King
  Cc: Junio C Hamano, Carlo Marcelo Arenas Belón, git,
	Randall S. Becker

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
  2025-05-28 18:59 Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
  2025-05-29 10:11 ` [PATCH] reftable: make REFTABLE_UNUSED C99 compatible Carlo Marcelo Arenas Belón
@ 2025-05-30 12:04 ` rsbecker
  2025-05-30 14:19   ` Kristoffer Haugsbakk
  2025-05-30 14:26   ` Patrick Steinhardt
  1 sibling, 2 replies; 13+ messages in thread
From: rsbecker @ 2025-05-30 12:04 UTC (permalink / raw)
  To: rsbecker, git

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
  2025-05-30 12:04 ` [Bug] Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
@ 2025-05-30 14:19   ` Kristoffer Haugsbakk
  2025-05-30 14:26   ` Patrick Steinhardt
  1 sibling, 0 replies; 13+ messages in thread
From: Kristoffer Haugsbakk @ 2025-05-30 14:19 UTC (permalink / raw)
  To: rsbecker, git

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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
  2025-05-30 12:04 ` [Bug] Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
  2025-05-30 14:19   ` Kristoffer Haugsbakk
@ 2025-05-30 14:26   ` Patrick Steinhardt
  2025-06-01  9:36     ` rsbecker
  1 sibling, 1 reply; 13+ messages in thread
From: Patrick Steinhardt @ 2025-05-30 14:26 UTC (permalink / raw)
  To: rsbecker; +Cc: git

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>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible
  2025-05-30  8:47         ` Patrick Steinhardt
@ 2025-05-30 16:28           ` Junio C Hamano
  0 siblings, 0 replies; 13+ messages in thread
From: Junio C Hamano @ 2025-05-30 16:28 UTC (permalink / raw)
  To: Patrick Steinhardt
  Cc: Jeff King, Carlo Marcelo Arenas Belón, git,
	Randall S. Becker

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop
  2025-05-30 14:26   ` Patrick Steinhardt
@ 2025-06-01  9:36     ` rsbecker
  0 siblings, 0 replies; 13+ messages in thread
From: rsbecker @ 2025-06-01  9:36 UTC (permalink / raw)
  To: 'Patrick Steinhardt'; +Cc: git

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-06-01  9:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28 18:59 Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
2025-05-29 10:11 ` [PATCH] reftable: make REFTABLE_UNUSED C99 compatible Carlo Marcelo Arenas Belón
2025-05-29 16:17   ` Junio C Hamano
2025-05-29 23:13     ` brian m. carlson
2025-05-30  4:12       ` Junio C Hamano
2025-05-30  5:35     ` Patrick Steinhardt
2025-05-30  6:25       ` Jeff King
2025-05-30  8:47         ` Patrick Steinhardt
2025-05-30 16:28           ` Junio C Hamano
2025-05-30 12:04 ` [Bug] Build Failure: Git 2.50.0-rc0 on NonStop rsbecker
2025-05-30 14:19   ` Kristoffer Haugsbakk
2025-05-30 14:26   ` Patrick Steinhardt
2025-06-01  9:36     ` rsbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).