From c5bbaeab5d2469a12dd323021328f08c0d45f98b Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Sat, 8 Nov 2025 14:54:18 +0000 Subject: [PATCH] STATIC_ASSERT for sizeof(struct ListMenu) --- src/list_menu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/list_menu.c b/src/list_menu.c index 8257712a0a..6929b20b42 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -13,6 +13,10 @@ #include "sound.h" #include "constants/songs.h" +// GF cast Task data to ListMenu in many places, which effectively puts +// an upper bound on sizeof(struct ListMenu). +STATIC_ASSERT(sizeof(struct ListMenu) <= sizeof(((struct Task *)NULL)->data), ListMenuTooLargeForTaskData); + // Cursors after this point are created using a sprite with their own task. // This allows them to have idle animations. Cursors prior to this are simply printed text. #define CURSOR_OBJECT_START CURSOR_RED_OUTLINE