Skip to content

Commit f1228cd

Browse files
carenasgitster
authored andcommitted
reftable: make REFTABLE_UNUSED C99 compatible
Since f93b2a0 (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" <[email protected]> Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fcfe606 commit f1228cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reftable/basics.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
#include "system.h"
1717
#include "reftable-basics.h"
1818

19+
#ifdef __GNUC__
1920
#define REFTABLE_UNUSED __attribute__((__unused__))
21+
#else
22+
#define REFTABLE_UNUSED
23+
#endif
2024

2125
/*
2226
* Initialize the buffer such that it is ready for use. This is equivalent to

0 commit comments

Comments
 (0)