Skip to contentSkip to conversation

magic-enum: Disable unused-value warning in tests

PATCH New [email protected] 1 participant 1 message Jun 28, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 magic-enum: Disable unused-value warning in tests

From: Ricardo Simoes <[email protected]>

With gcc 14.1.0, there is one compilation warning found in the unit tests which cause ptest builds to fail:

test_containers.cpp:290:89: error:
value computed is not used [-Werror=unused-value]
290 | magic_enum::containers::set color_set_not_const {Color::RED,

Color::GREEN, Color::BLUE};
      |

This is the same behavior as described in [1]. Thus, we can safely treat this specific warning not as an error until the gcc bug is fixed.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?format=multiple&id=114970

---
 meta-oe/recipes-extended/magic-enum/magic-enum_0.9.5.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-extended/magic-enum/magic-enum_0.9.5.bb +3 -0
index 096f869c3..ee547f634 100644
@@ -30,6 +30,9 @@ do_install_ptest () {
     install -m 0755 ${B}/test/test_* ${D}${PTEST_PATH}/tests
 }
 
+# Workaround for bug 114970 reported for gcc 14.1.0
+CXXFLAGS += "-Wno-error=unused-value"
+
 # Add catkin and colcon (ROS build system) support
 FILES:${PN}-dev += "\
     ${datadir}/magic_enum/package.xml \
Signature · 1 line
2.34.1