]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes for CLang
authorMaria Matejka <mq@ucw.cz>
Fri, 26 Jan 2024 13:50:36 +0000 (14:50 +0100)
committerMaria Matejka <mq@ucw.cz>
Fri, 26 Jan 2024 13:50:56 +0000 (14:50 +0100)
filter/decl.m4
nest/rt-attr.c
sysdep/unix/alloc.c
sysdep/unix/log.c

index e24ee94d49ee7a526e1ea1a4e81397ae3aa91fda..dcb24f8cf19cff928840a1efb5c6fcca8c4bdc3d 100644 (file)
@@ -622,6 +622,8 @@ FID_WR_PUT(11)
 #pragma GCC diagnostic ignored "-Woverride-init"
 #endif
 
+#pragma clang diagnostic ignored "-Winitializer-overrides"
+
 static struct sym_scope f_type_method_scopes[] = {
 FID_WR_PUT(12)
 };
index c8c2c0bbe89e4118630d58d5fd99decdff01f2e8..d8a91e39647cc2018a8b7045cbcc41432cc5da1b 100644 (file)
@@ -383,7 +383,7 @@ rt_dump_sources(struct rte_owner *o)
        (splitting % 8) ? ',' : '\n',
        (splitting % 8) ? ' ' : '\t',
        src->private_id, src->global_id,
-       atomic_load_explicit(&src->uc, memory_order_relaxed));
+       atomic_load_explicit(&src->uc.uc, memory_order_relaxed));
 
     splitting++;
   }
index 341c02a2e589176c94bfdd181d14b7e3ebcbb15b..6a2799939f1b24631a3f38eb1a5f1c6cb0523410 100644 (file)
@@ -105,7 +105,7 @@ long page_size = 0;
 #   define ajlog(...)
 
     struct free_page {
-      struct free_page *next;
+      struct free_page * _Atomic next;
     };
 
 # endif
@@ -259,7 +259,8 @@ free_page(void *ptr)
   struct free_page *fp = ptr;
   if (shutting_down || (pages_kept_here < KEEP_PAGES_MAX_LOCAL))
   {
-    UNUSED struct free_page *next = fp->next = local_page_stack;
+    struct free_page *next = local_page_stack;
+    atomic_store_explicit(&fp->next, next, memory_order_relaxed);
     PROTECT_PAGE(fp);
     local_page_stack = fp;
 
@@ -270,7 +271,8 @@ free_page(void *ptr)
   }
 
   /* If there are too many local pages, we add the free page to the global hot-free-page list */
-  UNUSED struct free_page *next = fp->next = PAGE_STACK_GET;
+  struct free_page *next = PAGE_STACK_GET;
+  atomic_store_explicit(&fp->next, next, memory_order_relaxed);
   PROTECT_PAGE(fp);
 
   /* Unblock the stack with the page being freed */
index 41c8f07f7a014caccf72484a39ad94637d2e8026..bbe1bd8e4adc569f6d68aa02767ffcd61c96fa07 100644 (file)
@@ -36,7 +36,7 @@ static pool *log_pool;
 static struct rfile *dbg_rf;
 static char *current_syslog_name = NULL; /* NULL -> syslog closed */
 
-_Atomic uint max_thread_id = ATOMIC_VAR_INIT(1);
+_Atomic uint max_thread_id = 1;
 _Thread_local uint this_thread_id;
 
 #include <pthread.h>