NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/61015: sys/dev/acpi/pckbc_acpi.c:242:63: error: 'handle' may be used uninitialized



>Number:         61015
>Category:       kern
>Synopsis:       sys/dev/acpi/pckbc_acpi.c:242:63: error: 'handle' may be used uninitialized
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 16 02:20:00 +0000 2026
>Originator:     linear
>Release:        11.1
>Organization:
>Environment:
>Description:
building with a slightly stripped-down kernel compared to GENERIC/i386 results in the following error:

/tank/src/sys/dev/acpi/pckbc_acpi.c:242:63: error: 'handle' may be used uninitialized [-Werror=maybe-uninitialized]

this does not happen on a GENERIC i386 kernel. i am guessing that somehow the compiler can prove handle is always initialized there, but can't do the same here. other variables in this function are explicitly initialized with a comment suggesting it's to make GCC happy.

doing the same for the handle quashes the error, allowing my custom kernel configuration to build successfully.
>How-To-Repeat:
strip down kernel configuration for i386, removing:
- recent graphics devices
- bluetooth
-  EFI / GPT
- ACPI
- HD audio support
- most USB support (kept kb/m, mass storage, usb serial, urtwn)
- MCA and EISA support
- a lot of SCSI controllers
- NVMe
- newer gigabit / pcie network devices
- most wireless devices
>Fix:
--- sys/dev/acpi/pckbc_acpi.c.orig      2026-11-15 21:05:57.148126244 -0500
+++ sys/dev/acpi/pckbc_acpi.c   2026-11-15 21:06:00.078646816 -0500
@@ -221,7 +221,7 @@
 {
        struct pckbc_acpi_softc *psc = NULL; /* XXX: gcc */
        void *rv = NULL;
-       ACPI_HANDLE handle;
+       ACPI_HANDLE handle = NULL;
        char intr_name[64];
        int i;




Home | Main Index | Thread Index | Old Index