]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: temporary workaround for a clang issue with atomics
authorMark Stapp <mjs@voltanet.io>
Tue, 30 Oct 2018 18:05:47 +0000 (14:05 -0400)
committerMark Stapp <mjs@voltanet.io>
Tue, 30 Oct 2018 19:31:47 +0000 (15:31 -0400)
Current clang has an issue with the pointer/target argument
to at least one atomic/intrinsic. A variable with '_Atomic'
generates a compile-time error. Use a cast as a workaround
here to allow use of clang for now.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/zebra_dplane.c

index 0581edfd6d9561969a927217e95eb3408cc57e35..61eba92c98f59b235e0e1f7ddc9918d91425712f 100644 (file)
@@ -651,8 +651,16 @@ static int dplane_route_enqueue(struct zebra_dplane_ctx *ctx)
        }
        DPLANE_UNLOCK();
 
-       curr = atomic_add_fetch_explicit(&zdplane_info.dg_routes_queued,
-                                        1, memory_order_seq_cst);
+       curr = atomic_add_fetch_explicit(
+#ifdef __clang__
+               /* TODO -- issue with the clang atomic/intrinsics currently;
+                * casting away the 'Atomic'-ness of the variable works.
+                */
+               (uint32_t *)&(zdplane_info.dg_routes_queued),
+#else
+               &(zdplane_info.dg_routes_queued),
+#endif
+               1, memory_order_seq_cst);
 
        /* Maybe update high-water counter also */
        high = atomic_load_explicit(&zdplane_info.dg_routes_queued_max,