]> wimlib.net Git - wimlib/commitdiff
Mark functions containing only static assertions intentionally unused
authorEric Biggers <ebiggers3@gmail.com>
Sat, 6 Feb 2016 15:47:11 +0000 (09:47 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 9 Feb 2016 01:44:19 +0000 (19:44 -0600)
include/wimlib/compiler.h
include/wimlib/reparse.h
include/wimlib/wof.h
src/lzms_compress.c

index 533930396e0134e657c80486bf8954f8f87baeb9..102deb73d2a1a4a72aa90c58b6d1128f21cd75df 100644 (file)
 /* TODO: _format_attribute is currently ignored.  */
 #define _format_attribute(type, format_str, format_start)
 
+/* 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 is
  * set to 1.  The other is set to 0.  Note that newer gcc supports
  * __BYTE_ORDER__ for easily determining the endianness; older gcc doesn't.  In
index 7627ad41cca4ce7aff1db00f9781aebade2ca75f..4c5316928ee5c93fda12dd42b87a3169f3912492 100644 (file)
@@ -49,7 +49,7 @@ struct reparse_buffer_disk {
 
 #define REPARSE_DATA_MAX_SIZE (REPARSE_POINT_MAX_SIZE - REPARSE_DATA_OFFSET)
 
-static inline void
+static _unused_attribute void
 check_reparse_buffer_disk(void)
 {
        STATIC_ASSERT(offsetof(struct reparse_buffer_disk, rpdata) == 8);
index f87cb45488db381944eec9827644fb95f6ae277a..ac07be512499badd2f271d4421049f75c368f48d 100644 (file)
@@ -291,7 +291,7 @@ struct WimOverlay_dat_entry_2 {
        } _packed_attribute;
 } _packed_attribute;
 
-static inline void
+static _unused_attribute void
 wof_check_structs(void)
 {
        STATIC_ASSERT(sizeof(struct WimOverlay_dat_header) == 24);
index 9a84ebd72ceea965e1b880b5f75504258ddacf25..8ee9e81839246ddbafa38de89611f85caf775e28 100644 (file)
@@ -170,7 +170,7 @@ struct lzms_item {
 #define DELTA_SOURCE_POWER_SHIFT       28
 #define DELTA_SOURCE_RAW_OFFSET_MASK   (((u32)1 << DELTA_SOURCE_POWER_SHIFT) - 1)
 
-static inline void
+static _unused_attribute void
 check_that_powers_fit_in_bitfield(void)
 {
        STATIC_ASSERT(LZMS_NUM_DELTA_POWER_SYMS <= (1 << (31 - DELTA_SOURCE_POWER_SHIFT)));
@@ -976,7 +976,7 @@ static const u32 lzms_bit_costs[LZMS_PROBABILITY_DENOMINATOR + 1] = {
        1
 };
 
-static inline void
+static _unused_attribute void
 check_cost_shift(void)
 {
        /* lzms_bit_costs is hard-coded to the current COST_SHIFT.  */