From: Eric Biggers Date: Thu, 30 Mar 2023 07:00:56 +0000 (-0700) Subject: compiler.h: remove _unused_attribute X-Git-Tag: v1.14.0~43 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=5a50cccf768a6bf6e9ccfd2337bcedc0cbf1ba6c compiler.h: remove _unused_attribute This abstraction layer serves no purpose. Just use __attribute__((unused)) directly. --- diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 58f0692a..40f92762 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -90,10 +90,6 @@ __attribute__((format(type, format_str, format_start))) #endif -/* Hint that the annotated function is intentionally not used. This might be - * the case if the function contains only static assertions. */ -#define _unused_attribute __attribute__((unused)) - /* Endianness definitions. Either CPU_IS_BIG_ENDIAN() or CPU_IS_LITTLE_ENDIAN() * evaluates to 1. The other evaluates to 0. Note that newer gcc supports * __BYTE_ORDER__ for easily determining the endianness; older gcc doesn't. In diff --git a/include/wimlib/reparse.h b/include/wimlib/reparse.h index 99d466c5..972780df 100644 --- a/include/wimlib/reparse.h +++ b/include/wimlib/reparse.h @@ -49,7 +49,7 @@ struct reparse_buffer_disk { #define REPARSE_DATA_MAX_SIZE (REPARSE_POINT_MAX_SIZE - REPARSE_DATA_OFFSET) -static _unused_attribute void +static void __attribute__((unused)) check_reparse_buffer_disk(void) { STATIC_ASSERT(offsetof(struct reparse_buffer_disk, rpdata) == 8); diff --git a/include/wimlib/wof.h b/include/wimlib/wof.h index b19319dd..6f5017be 100644 --- a/include/wimlib/wof.h +++ b/include/wimlib/wof.h @@ -417,7 +417,7 @@ struct WimOverlay_dat_entry_2 { } __attribute__((packed)); } __attribute__((packed)); -static _unused_attribute void +static void __attribute__((unused)) wof_check_structs(void) { STATIC_ASSERT(sizeof(struct WimOverlay_dat_header) == 24); diff --git a/src/lzms_compress.c b/src/lzms_compress.c index 5056cb30..428c289e 100644 --- a/src/lzms_compress.c +++ b/src/lzms_compress.c @@ -169,7 +169,7 @@ struct lzms_item { #define DELTA_SOURCE_POWER_SHIFT 28 #define DELTA_SOURCE_RAW_OFFSET_MASK (((u32)1 << DELTA_SOURCE_POWER_SHIFT) - 1) -static _unused_attribute void +static void __attribute__((unused)) check_that_powers_fit_in_bitfield(void) { STATIC_ASSERT(LZMS_NUM_DELTA_POWER_SYMS <= (1 << (31 - DELTA_SOURCE_POWER_SHIFT))); @@ -975,7 +975,7 @@ static const u32 lzms_bit_costs[LZMS_PROBABILITY_DENOMINATOR + 1] = { 1 }; -static _unused_attribute void +static void __attribute__((unused)) check_cost_shift(void) { /* lzms_bit_costs is hard-coded to the current COST_SHIFT. */ diff --git a/src/timestamp.c b/src/timestamp.c index 1e0eef3e..2d00cc6a 100644 --- a/src/timestamp.c +++ b/src/timestamp.c @@ -71,7 +71,7 @@ wim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts, } #ifdef _WIN32 -static _unused_attribute void +static void __attribute__((unused)) check_sizeof_time_t(void) { /* Windows builds should always be using 64-bit time_t now. */