From b11731d6b2165ed423450bf984c68fa7a355fb17 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Fri, 10 Dec 2021 15:39:19 +0100 Subject: [PATCH] dde_linux: silent warning in fork When initializing a task_struct within the lx_emul library we have to temporarily use a big object on the stack. Ref #4344 --- repos/dde_linux/src/lib/lx_emul/shadow/kernel/fork.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/repos/dde_linux/src/lib/lx_emul/shadow/kernel/fork.c b/repos/dde_linux/src/lib/lx_emul/shadow/kernel/fork.c index f6ee83e3c2..1032fe35cf 100644 --- a/repos/dde_linux/src/lib/lx_emul/shadow/kernel/fork.c +++ b/repos/dde_linux/src/lib/lx_emul/shadow/kernel/fork.c @@ -19,13 +19,19 @@ #include #include +/* + * We accept that we transfer the 4KiB task_struct object via stack in + * initialization, therefore mask the warning here + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wframe-larger-than=" pid_t kernel_thread(int (* fn)(void *),void * arg,unsigned long flags) { static int pid_counter = FIRST_PID; struct task_struct * task = kmalloc(sizeof(struct task_struct), GFP_KERNEL); - *task = (struct task_struct){ + *task = (struct task_struct) { .state = 0, .usage = REFCOUNT_INIT(2), .flags = PF_KTHREAD, @@ -57,3 +63,5 @@ pid_t kernel_thread(int (* fn)(void *),void * arg,unsigned long flags) lx_emul_task_create(task, "kthread", task->pid, fn, arg); return task->pid; } + +#pragma GCC diagnostic pop