diff mbox series

[meta-oe,5/5] kmscon: fix declaration after case label in font_psf

Message ID 20261015043859.3073445-5-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-networking,1/5] openl2tp: fix rpcbind status check in run-ptest | expand

Commit Message

Khem Raj Oct. 15, 2026, 4:38 a.m. UTC
kmscon builds with -std=gnu99 -Werror, and clang rejects the
declaration directly after the default: label in font_psf.c as a C23
extension. Give that case its own block scope.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...on-after-label-for-pre-C23-compilers.patch | 31 +++++++++++++++++++
 .../recipes-graphics/kmscon/kmscon_10.0.4.bb  |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/kmscon/kmscon/0003-font_psf-Fix-declaration-after-label-for-pre-C23-compilers.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/kmscon/kmscon/0003-font_psf-Fix-declaration-after-label-for-pre-C23-compilers.patch b/meta-oe/recipes-graphics/kmscon/kmscon/0003-font_psf-Fix-declaration-after-label-for-pre-C23-compilers.patch
new file mode 100644
index 0000000000..8bfec26d4e
--- /dev/null
+++ b/meta-oe/recipes-graphics/kmscon/kmscon/0003-font_psf-Fix-declaration-after-label-for-pre-C23-compilers.patch
@@ -0,0 +1,31 @@ 
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Sat, 10 Oct 2026 00:00:00 +0000
+Subject: [PATCH] font_psf: Fix declaration after label for pre-C23 compilers
+
+kmscon builds with -std=gnu99, where a label (including a case label)
+must be followed by a statement, not a declaration. Clang rejects the
+"uint8_t i" declaration directly after "default:" with
+-Werror,-Wc23-extensions. Give the default case its own block scope.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+--- a/src/font/font_psf.c
++++ b/src/font/font_psf.c
+@@ -394,7 +394,7 @@
+ 			case 0xff:
+ 				ch++;
+ 				break;
+-			default:
++			default: {
+ 				uint8_t i = utf8_len(code.map[0]);
+ 				if (i) {
+ 					code.val = ((uint32_t)(code.map[0] & (0xFF >> (2 + i)))
+@@ -408,6 +408,7 @@
+ 				if (unicode_table_add(self, code.val, ch))
+ 					return 1;
+ 			}
++			}
+ 		}
+ 		ucode_idx = 0;
+ 	}
diff --git a/meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb b/meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb
index 400d9b5f59..3ece44b175 100644
--- a/meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb
+++ b/meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb
@@ -26,6 +26,7 @@  SRCREV = "68fc8e1b2601e816e3a4ef95e3d8e700677509b9"
 SRC_URI += " \
     file://0001-uterm-treat-platform-display-controllers-as-primary-GPUs.patch \
     file://0002-vt_libseat-Fix-build-error-due-to-logging-changes.patch \
+    file://0003-font_psf-Fix-declaration-after-label-for-pre-C23-compilers.patch \
 "

 inherit meson pkgconfig systemd