From 67619bfde6aaeddfdc2eee5b9aa4b3f56b44b06b Mon Sep 17 00:00:00 2001 From: wenyuzifangtest001 Date: Mon, 15 Sep 2025 11:54:09 +0800 Subject: [PATCH] Update code from upstream --- setserial-c99.patch | 28 ++++++++++++++++++++++++++++ setserial-configure-c99.patch | 17 +++++++++++++++++ setserial.spec | 10 +++++++--- 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 setserial-c99.patch create mode 100644 setserial-configure-c99.patch diff --git a/setserial-c99.patch b/setserial-c99.patch new file mode 100644 index 0000000..4dbb16b --- /dev/null +++ b/setserial-c99.patch @@ -0,0 +1,28 @@ +Avoid implicit int and implicit function declarations. + +A mostly equivalent patch has been posted upstream: + + + +diff --git a/setserial.c b/setserial.c +index f184e98db07ceb59..d181327fc568ede4 100644 +--- a/setserial.c ++++ b/setserial.c +@@ -15,6 +15,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #ifdef HAVE_ASM_IOCTLS_H + #include +@@ -714,6 +717,7 @@ fprintf(stderr, "\t* port\t\tset the I/O port\n"); + exit(1); + } + ++int + main(int argc, char **argv) + { + int get_flag = 0, wild_intr_flag = 0; diff --git a/setserial-configure-c99.patch b/setserial-configure-c99.patch new file mode 100644 index 0000000..f9ed88d --- /dev/null +++ b/setserial-configure-c99.patch @@ -0,0 +1,17 @@ +This fixes a generic C99 compatibility issue in autoconf-generated +code. No need to upstream this because the issue goes away if +autoconf is re-run. + +diff --git a/configure b/configure +index 9d6084aa38e5d6e8..4d948816e1112d13 100755 +--- a/configure ++++ b/configure +@@ -689,7 +689,7 @@ cat > conftest.$ac_ext << EOF + #line 690 "configure" + #include "confdefs.h" + +-main(){return(0);} ++int main(){return(0);} + EOF + if { (eval echo configure:695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes diff --git a/setserial.spec b/setserial.spec index e72f5c9..d03b67f 100644 --- a/setserial.spec +++ b/setserial.spec @@ -1,15 +1,17 @@ -%define anolis_release 1 +%define anolis_release 2 Summary: A utility for configuring serial ports Name: setserial -Version: 2.17 +Version: 2.17 Release: %{anolis_release}%{?dist} -Source: https://sourceforge.net/projects/setserial/files/setserial/%{version}/%{name}-%{version}.tar.gz Patch0: setserial-2.17-fhs.patch Patch1: setserial-2.17-rc.patch Patch2: setserial-aarch64.patch +Patch3: setserial-configure-c99.patch +Patch4: setserial-c99.patch License: GPL+ URL: http://setserial.sourceforge.net/ +Source0: https://sourceforge.net/projects/setserial/files/setserial/2.17/setserial-2.17.tar.gz BuildRequires: make BuildRequires: gcc @@ -62,5 +64,7 @@ make install DESTDIR=${RPM_BUILD_ROOT} %doc README rc.serial %changelog +* Mon Sep 15 2025 Wenyuzifangtest001 - 2.17-2 +- Ensure compatibility with C99 compilers by fixing implicit int in main() * Thu Mar 16 2023 Yuanhong Peng - 2.17-1 - Init from upstream -- Gitee