From 81ca6314f4933abfea51eb34a3bc633aca100ff6 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Wed, 12 Aug 2026 14:31:53 +0200 Subject: [PATCH] =?UTF-8?q?fix(compile):=20-Wno-error=3Duninitialized=20?= =?UTF-8?q?=E2=80=94=20M5Stack's=20own=20MahonyAHRS=20trips=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The library's fast inverse square root reads a float through a long*, GCC flags y as used uninitialized, and -Werror turns a vendor library the user cannot edit into a failed build. Demoted to a warning like its siblings. --- .../esp-idf-template/main/CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/app/services/esp-idf-template/main/CMakeLists.txt b/backend/app/services/esp-idf-template/main/CMakeLists.txt index cb13cc6c..82580dcf 100644 --- a/backend/app/services/esp-idf-template/main/CMakeLists.txt +++ b/backend/app/services/esp-idf-template/main/CMakeLists.txt @@ -29,7 +29,13 @@ if(DEFINED ENV{VELXIO_PURE_SKETCH}) -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=format - -Wno-error=maybe-uninitialized) + -Wno-error=maybe-uninitialized + # uninitialized (the non-maybe flavour) fires inside the M5Stack + # library itself: MahonyAHRS.cpp's fast inverse square root reads the + # float through a long* — deliberate, thirty years old, and fatal + # under -Werror. Library code the user cannot edit must not stop + # their build. + -Wno-error=uninitialized) # If Arduino component is available, use C++ main and link Arduino. # The component name matches the directory basename of ARDUINO_ESP32_PATH # (e.g. "arduino-esp32" when cloned from GitHub). @@ -143,7 +149,13 @@ elseif(DEFINED ENV{ARDUINO_ESP32_PATH}) # must compile here, or the emulator looks broken for a sketch that # is not. -Wno-error=format - -Wno-error=maybe-uninitialized) + -Wno-error=maybe-uninitialized + # uninitialized (the non-maybe flavour) fires inside the M5Stack + # library itself: MahonyAHRS.cpp's fast inverse square root reads the + # float through a long* — deliberate, thirty years old, and fatal + # under -Werror. Library code the user cannot edit must not stop + # their build. + -Wno-error=uninitialized) else() # Pure ESP-IDF mode: main.c #includes sketch_translated.c idf_component_register(