]> git.kaiwu.me - haproxy.git/commitdiff
BUILD: task: Fix build when no 8B CAS is available at all master
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 9 Jul 2026 14:10:17 +0000 (16:10 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 9 Jul 2026 14:05:54 +0000 (16:05 +0200)
clang (rightfully) complains that when neither HA_CAS_IS_8B nor
HA_HAVE_CAS_DW is defined, there is a mismatch when we're doing a CAS,
as we're mixing unsigned int and int.
To fix that, just turn old_state to an unsigned int, as it should be.

This should fix github issue #3441

include/haproxy/task.h

index a1a33defee4ff2c22ddcab63f8383f52ff0ebbfc..b0da721afe703549727588e6e349d32a36cdde14 100644 (file)
@@ -245,7 +245,7 @@ static inline int __task_set_state_and_tid(struct task *t, int expected_tid, int
 #endif
        return 1;
 #else /* !HA_CAS_IS_8B && !HA_HAVE_CAS_DW */
-       int old_state;
+       unsigned int old_state;
        int ret = 0;
 
        HA_SPIN_LOCK(OTHER_LOCK, &task_state_tid);