From 7eed950126b69e6ea04eea2cc6f900a4d17496ef Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Apr 2026 18:47:03 -0700 Subject: [PATCH] libtar: Fix build with clang-22 -std=gnu23 Signed-off-by: Khem Raj --- ...-R-function-definitions-to-ANSI-C-pr.patch | 62 +++++++++++++++++++ .../recipes-support/libtar/libtar_1.2.20.bb | 1 + 2 files changed, 63 insertions(+) create mode 100644 meta-oe/recipes-support/libtar/files/0001-compat-convert-K-R-function-definitions-to-ANSI-C-pr.patch diff --git a/meta-oe/recipes-support/libtar/files/0001-compat-convert-K-R-function-definitions-to-ANSI-C-pr.patch b/meta-oe/recipes-support/libtar/files/0001-compat-convert-K-R-function-definitions-to-ANSI-C-pr.patch new file mode 100644 index 0000000000..4585c586b4 --- /dev/null +++ b/meta-oe/recipes-support/libtar/files/0001-compat-convert-K-R-function-definitions-to-ANSI-C-pr.patch @@ -0,0 +1,62 @@ +From 5ea04d70221a18cbd711a9d570c81ef0b9be6765 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 10 Apr 2026 18:41:04 -0700 +Subject: [PATCH] compat: convert K&R function definitions to ANSI C prototypes + +Replace old-style K&R parameter declarations with modern ANSI C +function prototypes in basename.c, dirname.c, and strmode.c. + +Required for compatibility with clang 22 under -std=gnu23, which +no longer supports K&R-style function definitions. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compat/basename.c | 3 +-- + compat/dirname.c | 3 +-- + compat/strmode.c | 4 +--- + 3 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/compat/basename.c b/compat/basename.c +index 2ac1e13..7b0384a 100644 +--- a/compat/basename.c ++++ b/compat/basename.c +@@ -36,8 +36,7 @@ static char rcsid[] = "$OpenBSD: basename.c,v 1.4 1999/05/30 17:10:30 espie Exp + #include + + char * +-openbsd_basename(path) +- const char *path; ++openbsd_basename(const char *path) + { + static char bname[MAXPATHLEN]; + register const char *endp, *startp; +diff --git a/compat/dirname.c b/compat/dirname.c +index 986db4a..6c1231d 100644 +--- a/compat/dirname.c ++++ b/compat/dirname.c +@@ -36,8 +36,7 @@ static char rcsid[] = "$OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $ + #include + + char * +-openbsd_dirname(path) +- const char *path; ++openbsd_dirname (const char *path) + { + static char bname[MAXPATHLEN]; + register const char *endp; +diff --git a/compat/strmode.c b/compat/strmode.c +index 5e7f15e..2ffab61 100644 +--- a/compat/strmode.c ++++ b/compat/strmode.c +@@ -40,9 +40,7 @@ static char *rcsid = "$OpenBSD: strmode.c,v 1.3 1997/06/13 13:57:20 deraadt Exp + #include + + void +-strmode(mode, p) +- register mode_t mode; +- register char *p; ++strmode (register mode_t mode, register char *p) + { + /* print type */ + switch (mode & S_IFMT) { diff --git a/meta-oe/recipes-support/libtar/libtar_1.2.20.bb b/meta-oe/recipes-support/libtar/libtar_1.2.20.bb index a17509d2e5..39d410064e 100644 --- a/meta-oe/recipes-support/libtar/libtar_1.2.20.bb +++ b/meta-oe/recipes-support/libtar/libtar_1.2.20.bb @@ -20,6 +20,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/libt/${BPN}/${BPN}_${PV}.orig.tar.gz \ file://CVE-2021-33643-CVE-2021-33644.patch \ file://CVE-2021-33640-CVE-2021-33645-CVE-2021-33646.patch \ file://CVE-2013-4420.patch \ + file://0001-compat-convert-K-R-function-definitions-to-ANSI-C-pr.patch \ " S = "${UNPACKDIR}/${BPN}"