From 31a86a186874fc6425195342c7bebb8080bacdbc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 16 Sep 2022 19:53:50 -0700 Subject: nan-boxing: warning fix for gcc 12. gcc 12.2.0, targetting RISC-V, emitted a warning for the c_f function that the &u expression uses an uninitialized u, even though u is declared with an initializer. Code builds otherwise and tests pass. * lib.h (c_f): Also suppress and re-enable the -Wuninitialized option. --- lib.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib.h b/lib.h index c15e1ff5..dc12c355 100644 --- a/lib.h +++ b/lib.h @@ -623,6 +623,7 @@ INLINE ucnum c_u(val num) #if CONFIG_NAN_BOXING && defined __GNUC__ #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wuninitialized" #endif INLINE double c_f(val num) @@ -637,6 +638,7 @@ INLINE double c_f(val num) #if CONFIG_NAN_BOXING && defined __GNUC__ #pragma GCC diagnostic warning "-Wstrict-aliasing" +#pragma GCC diagnostic warning "-Wuninitialized" #endif #if SIZEOF_WCHAR_T < 4 && !CONFIG_NAN_BOXING -- cgit v1.2.3