From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

bsd: disable false-positive warning

Gcc 12.1.1 started complaining on bsd/sys/kern/subr_taskqueue.c's
taskqueue_run_locked() that a pointer to an on-stack object (tb) is saved
on a heap variable (queue).

However, I believe this is a false positive: This code indeed adds a
local object to a queue, but before returning from the function, it
removes this local object from the queue, so the pointer to the stack
cannot remain after this function returns. I don't know why gcc thinks
it can prove that it can remain.

So in this patch I simply disable "dangling-pointer" checking on this
source file.

This is one of the fixes needed to build on Fedora 36 (refs #1198).

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -574,6 +574,7 @@ bsd += bsd/sys/kern/subr_sbuf.o
 bsd += bsd/sys/kern/subr_eventhandler.o
 bsd += bsd/sys/kern/subr_hash.o
 bsd += bsd/sys/kern/subr_taskqueue.o
+$(out)/bsd/sys/kern/subr_taskqueue.o: COMMON += -Wno-dangling-pointer
 bsd += bsd/sys/kern/sys_socket.o
 bsd += bsd/sys/kern/subr_disk.o
 bsd += bsd/porting/route.o

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000c84d1205e24c4f12%40google.com.

Reply via email to