diff mbox series

lrzsz: Convert K&R function definitions to ANSI C prototypes

Message ID 20260401210621.3438170-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series lrzsz: Convert K&R function definitions to ANSI C prototypes | expand

Commit Message

Khem Raj April 1, 2026, 9:06 p.m. UTC
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...R-function-definitions-to-ANSI-C-pro.patch | 64 +++++++++++++++++++
 meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb       |  1 +
 2 files changed, 65 insertions(+)
 create mode 100644 meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-lrzsz-convert-K-R-function-definitions-to-ANSI-C-pro.patch

Comments

patchtest@automation.yoctoproject.org April 1, 2026, 9:15 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/lrzsz-Convert-K-R-function-definitions-to-ANSI-C-prototypes.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-lrzsz-convert-K-R-function-definitions-to-ANSI-C-pro.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-lrzsz-convert-K-R-function-definitions-to-ANSI-C-pro.patch
new file mode 100644
index 0000000000..afffc00bbd
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-lrzsz-convert-K-R-function-definitions-to-ANSI-C-pro.patch
@@ -0,0 +1,64 @@ 
+From bec790ecc4618b67604668601f84fa896476572c Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Wed, 1 Apr 2026 13:53:42 -0700
+Subject: [PATCH] lrzsz: convert K&R function definitions to ANSI C prototypes
+
+clang-22 with -std=gnu23 fails to build lrzsz because lib/long-options.c and
+lib/xstrtol.c still use old K&R-style function definitions, which
+newer toolchains reject.
+
+Rewrite parse_long_options() and __xstrtol() using standard prototype
+syntax so the sources compile cleanly with modern compilers.
+
+Upstream-Status: Submitted [https://github.com/UweOhse/lrzsz/pull/10]
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ lib/long-options.c | 11 ++++++-----
+ lib/xstrtol.c      | 12 ++++++------
+ 2 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/lib/long-options.c b/lib/long-options.c
+index 2c8d267..71d0e65 100644
+--- a/lib/long-options.c
++++ b/lib/long-options.c
+@@ -36,11 +36,12 @@ static struct option const long_options[] =
+ /* Process long options --help and --version, but only if argc == 2.
+    Be careful not to gobble up `--'.  */
+ void
+-parse_long_options (argc, argv,version, usage)
+-     int argc;
+-     char **argv;
+-     void (*version)();
+-     void (*usage)(int);
++parse_long_options (
++     int argc,
++     char **argv,
++     void (*version)(),
++     void (*usage)(int)
++)
+ {
+   int c;
+   int saved_opterr;
+diff --git a/lib/xstrtol.c b/lib/xstrtol.c
+index 0ab337d..a34e23b 100644
+--- a/lib/xstrtol.c
++++ b/lib/xstrtol.c
+@@ -68,12 +68,12 @@ extern int errno;
+ /* FIXME: comment.  */
+ 
+ strtol_error
+-__xstrtol (s, ptr, base, val, valid_suffixes)
+-     const char *s;
+-     char **ptr;
+-     int base;
+-     __unsigned long int *val;
+-     const char *valid_suffixes;
++__xstrtol (
++     const char *s,
++     char **ptr,
++     int base,
++     __unsigned long int *val,
++     const char *valid_suffixes)
+ {
+   char *t_ptr;
+   char **p;
diff --git a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
index 777560bd22..042cf7fbac 100644
--- a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
+++ b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
@@ -20,6 +20,7 @@  SRC_URI = "https://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \
            file://include.patch \
            file://0001-Fix-cross-compilation-using-autoconf-detected-AR.patch \
            file://0001-Fix-build-with-GCC-15.patch \
+           file://0001-lrzsz-convert-K-R-function-definitions-to-ANSI-C-pro.patch \
            "
 SRC_URI[sha256sum] = "c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1"