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>
This commit is contained in:
lmamane 2025-03-14 12:10:41 +00:00 committed by GitHub
parent 30e56834d5
commit c0638c6007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -241,7 +241,12 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
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};