kmscon: fix declaration after case label in font_psf

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>
This commit is contained in:
Khem Raj committed 2026-10-14 21:41:33 -07:00
1 parent bc071ba133
commit 185fd318f8
2 files changed
+32

No files matched your search

@@ -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;
}
@@ -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