Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2026 19:14:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 292811] sys/kern/imgact_elf.c:2722:18: error: variable 'structsize' is uninitialized when passed as a const pointer argument here
Message-ID:  <bug-292811-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292811

            Bug ID: 292811
           Summary: sys/kern/imgact_elf.c:2722:18: error: variable
                    'structsize' is uninitialized when passed as a const
                    pointer argument here
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: wosch@FreeBSD.org

I tried to run `make buildkernel' with clang21 on macOS. I get the error:

--- imgact_elf.o ---
sys/kern/imgact_elf.c:2722:18: error: variable 'structsize' is uninitialized
when passed as a const pointer argument here
[-Werror,-Wuninitialized-const-pointer]
 2722 |                 sbuf_bcat(sb, &structsize, sizeof(structsize));

clang21 is right, it is not a good idea to copy an uninitialized local int
variable.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-292811-227>