]> wimlib.net Git - wimlib/commitdiff
compiler.h: remove _may_alias_attribute
authorEric Biggers <ebiggers3@gmail.com>
Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 30 Mar 2023 07:16:51 +0000 (00:16 -0700)
This abstraction layer serves no purpose.  Just use
__attribute__((may_alias)) directly.

include/wimlib/compiler.h
src/lcpit_matchfinder.c
src/resource.c
src/write.c

index 612c058c560cf812461b0bdae82f50cc0a221417..58f0692a58229536ac2a34d40598b6ee53085ae4 100644 (file)
@@ -73,9 +73,6 @@
 /* Prefetch into L1 cache for write.  */
 #define prefetchw(addr)                __builtin_prefetch((addr), 1)
 
-/* Declare that pointers to the annotated type may alias other pointers.  */
-#define _may_alias_attribute   __attribute__((may_alias))
-
 /* Hint that the annotated function is rarely called.  */
 #if GCC_PREREQ(4, 4) || __has_attribute(cold)
 #  define _cold_attribute      __attribute__((cold))
index b956859c681c00ed737b04add05917b332f6cfb1..a1a1c02ae61e9059c7edbc13015991dd727154f1 100644 (file)
@@ -375,8 +375,8 @@ lcpit_advance_one_byte(const u32 cur_pos,
 static void
 expand_SA(void *p, u32 n)
 {
-       typedef u32 _may_alias_attribute aliased_u32_t;
-       typedef u64 _may_alias_attribute aliased_u64_t;
+       typedef u32 __attribute__((may_alias)) aliased_u32_t;
+       typedef u64 __attribute__((may_alias)) aliased_u64_t;
 
        aliased_u32_t *SA = p;
        aliased_u64_t *SA64 = p;
index 0036c1b90377823ce4dee8502a70323289c4ba04..2fe57affde04d9e4b61eafabd1b8c53df7681b9b 100644 (file)
@@ -333,8 +333,8 @@ read_compressed_wim_resource(const struct wim_resource_descriptor * const rdesc,
                /* Now fill in chunk_offsets from the entries we have read in
                 * chunk_tab_data.  We break aliasing rules here to avoid having
                 * to allocate yet another array.  */
-               typedef le64 _may_alias_attribute aliased_le64_t;
-               typedef le32 _may_alias_attribute aliased_le32_t;
+               typedef le64 __attribute__((may_alias)) aliased_le64_t;
+               typedef le32 __attribute__((may_alias)) aliased_le32_t;
                u64 * chunk_offsets_p = chunk_offsets;
 
                if (alt_chunk_table) {
index 2fa83f775c975bdb0ff3fe14766377b384517e77..fa0b691327eee4e0151d5d3a3d2d55eae3ad2629 100644 (file)
@@ -506,8 +506,8 @@ end_chunk_table(struct write_blobs_ctx *ctx, u64 res_actual_size,
                                                0 != (ctx->write_resource_flags &
                                                      WRITE_RESOURCE_FLAG_SOLID));
 
-       typedef le64 _may_alias_attribute aliased_le64_t;
-       typedef le32 _may_alias_attribute aliased_le32_t;
+       typedef le64 __attribute__((may_alias)) aliased_le64_t;
+       typedef le32 __attribute__((may_alias)) aliased_le32_t;
 
        if (chunk_entry_size == 4) {
                aliased_le32_t *entries = (aliased_le32_t*)ctx->chunk_csizes;