From c7a0d6de46610ac9ceaea5afe1b7983550fc1be6 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Thu, 26 Dec 2024 18:37:01 -0700 Subject: libcr: Tell GCC that coroutine_table[n].name might not be nul-terminated --- libcr/coroutine.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libcr/coroutine.c') diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 05892c3..32253c8 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -46,6 +46,10 @@ #error config.h must define CONFIG_COROUTINE_GDB (bool) #endif +/* Enforce that CONFIG_COROUTINE_NUM is greater than 1, to work around + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118212 */ +static_assert(CONFIG_COROUTINE_NUM > 1); + /* Implementation *************************************************************/ #if CONFIG_COROUTINE_VALGRIND @@ -386,7 +390,7 @@ struct coroutine { #if CONFIG_COROUTINE_VALGRIND unsigned stack_id; #endif - char name[CONFIG_COROUTINE_NAME_LEN]; + [[gnu::nonstring]] char name[CONFIG_COROUTINE_NAME_LEN]; }; /* constants ******************************************************************/ -- cgit v1.2.3-2-g168b