InfiniTime.git

commit c0638c600707805b84757177c3e1ea61e1e026e0

Author: lmamane <lmamane@users.noreply.github.com>

work around g++ version 12, 13 and 14 spurious warning (#2158)

which is an error since we compile with -Werror

Co-authored-by: Lionel Elie Mamane <lionel@mamane.lu>

 src/displayapp/screens/SystemInfo.cpp | 5 +++++


diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index 886dacb6c6f5056aa3e93b0cb60a2a7772fe1548..01204aeda54e382d1eae72e97f41770215a81eb3 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -241,7 +241,12 @@   lv_table_set_cell_value(infoTask, 0, 3, "Free");
   lv_table_set_col_width(infoTask, 3, 90);
 
   auto nb = uxTaskGetSystemState(tasksStatus, maxTaskCount, nullptr);
+// g++ emits a spurious warning (and thus error because we compile with -Werror)
+// due to the way std::sort is implemented
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
   std::sort(tasksStatus, tasksStatus + nb, sortById);
+#pragma GCC diagnostic pop
   for (uint8_t i = 0; i < nb && i < maxTaskCount; i++) {
     char buffer[11] = {0};