From 0c4ba7dd553afa69b179928b29a84c3d12ef7e93 Mon Sep 17 00:00:00 2001 From: Ludovic LANGE Date: Tue, 25 Apr 2023 23:58:39 +0200 Subject: [PATCH] fix compilation warning "infinite recursion detected" In ESP-IDFv5.1 branch, more warnings are turned into error. In particular here, `-Werror=infinite-recursion` gives the following error: ``` main/test_framework.cpp: In function 'void test_stackoverflow(int, OvmsWriter*, OvmsCommand*, int, const char* const*)': main/test_framework.cpp:174:6: error: infinite recursion detected [-Werror=infinite-recursion] 174 | void test_stackoverflow(int verbosity, OvmsWriter* writer, OvmsCommand* cmd, int argc, const char* const* argv) | ^~~~~~~~~~~~~~~~~~ main/test_framework.cpp:180:21: note: recursive call 180 | test_stackoverflow(verbosity+1, writer, cmd, argc, argv); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` We add an attribute to confirm that we know what we're doing here. Signed-off-by: Ludovic LANGE --- vehicle/OVMS.V3/main/test_framework.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/vehicle/OVMS.V3/main/test_framework.cpp b/vehicle/OVMS.V3/main/test_framework.cpp index 649fbf10b..c964c73da 100644 --- a/vehicle/OVMS.V3/main/test_framework.cpp +++ b/vehicle/OVMS.V3/main/test_framework.cpp @@ -171,6 +171,7 @@ void test_watchdog(int verbosity, OvmsWriter* writer, OvmsCommand* cmd, int argc writer->puts("Error: We should never get here"); } +__attribute__((noreturn)) void test_stackoverflow(int verbosity, OvmsWriter* writer, OvmsCommand* cmd, int argc, const char* const* argv) { uint8_t data[256];