diff --git a/share/libc/stdatomic.c b/share/libc/stdatomic.c index caaeb092968e738ef6136cab09d5f35655753f2e..5121379c4eb3bb3562ab41ad7a9ce90910ad5fd9 100644 --- a/share/libc/stdatomic.c +++ b/share/libc/stdatomic.c @@ -60,7 +60,7 @@ unsigned long long __fc_atomic_load_explicit(void *object, unsigned long long __fc_atomic_exchange(void *obj, unsigned long long desired, size_t obj_size) { - unsigned long long r; + unsigned long long r = 0; if (obj_size == sizeof(char)) { r = *((volatile atomic_uchar *)obj); *((volatile atomic_uchar *)obj) = desired; @@ -120,7 +120,7 @@ _Bool __fc_atomic_compare_exchange_weak_explicit(void *object, void *expected, unsigned long long __fc_atomic_fetch_add(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = 0; if (obj_size == sizeof(char)) { r = *((volatile atomic_uchar *)obj); *((volatile atomic_uchar *)obj) += operand; @@ -149,7 +149,7 @@ unsigned long long __fc_atomic_fetch_add_explicit(void *obj, unsigned long long __fc_atomic_fetch_sub(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = 0; if (obj_size == sizeof(char)) { r = *((volatile atomic_uchar *)obj); *((volatile atomic_uchar *)obj) -= operand; } else if (obj_size == sizeof(short)) { r = *((volatile atomic_ushort *)obj); @@ -173,7 +173,7 @@ unsigned long long __fc_atomic_fetch_sub_explicit(void *obj, unsigned long long __fc_atomic_fetch_or(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = 0; if (obj_size == sizeof(char)) { r = *((volatile atomic_uchar *)obj); *((volatile atomic_uchar *)obj) |= operand; } else if (obj_size == sizeof(short)) { r = *((volatile atomic_ushort *)obj); @@ -197,7 +197,7 @@ unsigned long long __fc_atomic_fetch_or_explicit(void *obj, unsigned long long __fc_atomic_fetch_xor(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = 0; if (obj_size == sizeof(char)) { r = *((volatile atomic_uchar *)obj); *((volatile atomic_uchar *)obj) ^= operand; @@ -228,7 +228,7 @@ unsigned long long __fc_atomic_fetch_xor_explicit(void *obj, unsigned long long __fc_atomic_fetch_and(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = 0; if (obj_size == sizeof(char)) { r = *((volatile atomic_uchar *)obj); *((volatile atomic_uchar *)obj) &= operand; diff --git a/tests/libc/oracle/fc_libc.0.res.oracle b/tests/libc/oracle/fc_libc.0.res.oracle index 297a5e0531ddf030c077d5e04b5d1a2491d53f2a..cd64f335d7062a908bb5a2c917a8c6d87f1ffdbb 100644 --- a/tests/libc/oracle/fc_libc.0.res.oracle +++ b/tests/libc/oracle/fc_libc.0.res.oracle @@ -213,13 +213,13 @@ Global metrics ============== - Sloc = 1641 + Sloc = 1647 Decision point = 307 Global variables = 86 If = 292 Loop = 55 Goto = 118 - Assignment = 711 + Assignment = 717 Exit point = 128 Function = 556 Function call = 165 diff --git a/tests/libc/oracle/fc_libc.1.res.oracle b/tests/libc/oracle/fc_libc.1.res.oracle index 7053e853eeefa1d2d9c6aab5ee50cf5f00599c28..36845c92b1273d28079d0b856a9f89f5d6f48cb5 100644 --- a/tests/libc/oracle/fc_libc.1.res.oracle +++ b/tests/libc/oracle/fc_libc.1.res.oracle @@ -5865,7 +5865,7 @@ unsigned long long __fc_atomic_exchange(void *obj, unsigned long long desired, size_t obj_size) { - unsigned long long r; + unsigned long long r = (unsigned long long)0; if (obj_size == sizeof(char)) { r = (unsigned long long)*((atomic_uchar volatile *)obj); *((atomic_uchar volatile *)obj) = (unsigned char)desired; @@ -5953,7 +5953,7 @@ unsigned long long __fc_atomic_fetch_add(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = (unsigned long long)0; if (obj_size == sizeof(char)) { r = (unsigned long long)*((atomic_uchar volatile *)obj); *((atomic_uchar volatile *)obj) = (unsigned char)((unsigned long long)*((atomic_uchar volatile *)obj) + operand); @@ -5996,7 +5996,7 @@ unsigned long long __fc_atomic_fetch_sub(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = (unsigned long long)0; if (obj_size == sizeof(char)) { r = (unsigned long long)*((atomic_uchar volatile *)obj); *((atomic_uchar volatile *)obj) = (unsigned char)((unsigned long long)*((atomic_uchar volatile *)obj) - operand); @@ -6039,7 +6039,7 @@ unsigned long long __fc_atomic_fetch_or(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = (unsigned long long)0; if (obj_size == sizeof(char)) { r = (unsigned long long)*((atomic_uchar volatile *)obj); *((atomic_uchar volatile *)obj) = (unsigned char)((unsigned long long)*((atomic_uchar volatile *)obj) | operand); @@ -6082,7 +6082,7 @@ unsigned long long __fc_atomic_fetch_xor(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = (unsigned long long)0; if (obj_size == sizeof(char)) { r = (unsigned long long)*((atomic_uchar volatile *)obj); *((atomic_uchar volatile *)obj) = (unsigned char)((unsigned long long)*((atomic_uchar volatile *)obj) ^ operand); @@ -6125,7 +6125,7 @@ unsigned long long __fc_atomic_fetch_and(void *obj, unsigned long long operand, size_t obj_size) { - unsigned long long r; + unsigned long long r = (unsigned long long)0; if (obj_size == sizeof(char)) { r = (unsigned long long)*((atomic_uchar volatile *)obj); *((atomic_uchar volatile *)obj) = (unsigned char)((unsigned long long)*((atomic_uchar volatile *)obj) & operand);