From a16f9a4900c779b8eb0b9ba3500b23450d25fecd Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 3 Jan 2026 19:03:03 +0100 Subject: [PATCH] Specify the ProcessState enum to be one byte in size, with static assert --- kern/proc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kern/proc.h b/kern/proc.h index 489876e..ca2fa93 100644 --- a/kern/proc.h +++ b/kern/proc.h @@ -5,7 +5,7 @@ #include #include -typedef enum { +typedef enum : uint8_t { UNUSED, USED, SLEEPING, @@ -14,6 +14,8 @@ typedef enum { ZOMBIE, } ProcessState; +_Static_assert(sizeof(ProcessState) == 1, ""); + /** Saved registers for kernel context switches. */ typedef struct Context { uint64_t ra;