|
From: | Richard Henderson |
Subject: | Re: [PATCH v3 01/10] qemu/atomic: Use macros for CONFIG_ATOMIC64 |
Date: | Tue, 20 Jul 2021 10:38:19 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 7/19/21 2:01 AM, Peter Maydell wrote:
-static inline void qatomic_set_u64(uint64_t *ptr, uint64_t val) -{ - qatomic_set__nocheck(ptr, val); -}
...
+#define qatomic_set_u64 qatomic_set__nocheckPreviously if you tried to do qatomic_set_i64() etc on something that wasn't an int64_t*, the compiler would complain. Now it will silently store a different-sized value, I think. Is there a way to retain the typechecking in the macro versions?
I can add a trivial _Generic wrapper. r~
[Prev in Thread] | Current Thread | [Next in Thread] |