Module Name:    src
Committed By:   rin
Date:           Wed Sep 25 09:08:22 UTC 2024

Modified Files:
        src/sys/arch/luna68k/stand/boot: sc.c

Log Message:
luna68k/boot: XXX: Silence GCC12 -Warray-bounds for scident()

sensebuf and inqbuf may be uninitialized for some cases.

Real fix should be to check return values everywhere in
scsi_request_sense(), scsi_immed_command(), and functions
called from them.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/luna68k/stand/boot/sc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/luna68k/stand/boot/sc.c
diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.19 src/sys/arch/luna68k/stand/boot/sc.c:1.20
--- src/sys/arch/luna68k/stand/boot/sc.c:1.19	Fri Dec 10 20:36:02 2021
+++ src/sys/arch/luna68k/stand/boot/sc.c	Wed Sep 25 09:08:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sc.c,v 1.19 2021/12/10 20:36:02 andvar Exp $	*/
+/*	$NetBSD: sc.c,v 1.20 2024/09/25 09:08:22 rin Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -174,6 +174,16 @@ screset(struct scsi_softc *hs)
 	printf(", ID %d\n", SCSI_ID);
 }
 
+/*
+ * XXX
+ * sensebuf and inqbuf may be uninitialized for some cases.
+ * Real fix should be to check return values everywhere in
+ * scsi_request_sense(), scsi_immed_command(), and functions
+ * called from them.
+ */
+#pragma GCC diagnostic push					/* XXX { */
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+
 bool
 scident(uint ctlr, uint target, uint lun, struct scsi_inquiry *inqout,
     uint32_t *capout)
@@ -236,6 +246,8 @@ scident(uint ctlr, uint target, uint lun
 	return true;
 }
 
+#pragma GCC diagnostic pop					/* XXX } */
+
 static void
 scprobe(struct scsi_softc *hs, uint target, uint lun)
 {

Reply via email to