From 441de5ba01419069332b658a1bb068c1771b11d2 Mon Sep 17 00:00:00 2001 From: wenyuzifang Date: Mon, 29 Sep 2025 12:16:54 +0800 Subject: [PATCH] Update code from upstream --- xmlto-c99-1.patch | 26 ++++++++++++++++++++++++++ xmlto-c99-2.patch | 35 +++++++++++++++++++++++++++++++++++ xmlto.spec | 13 ++++++++++--- 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 xmlto-c99-1.patch create mode 100644 xmlto-c99-2.patch diff --git a/xmlto-c99-1.patch b/xmlto-c99-1.patch new file mode 100644 index 0000000..8ba8416 --- /dev/null +++ b/xmlto-c99-1.patch @@ -0,0 +1,26 @@ +commit 1375e2df75530cd198bd16ac3de38e2b0d126276 +Author: Thomas Kuehne +Date: Sat Dec 11 21:10:41 2021 +0100 + + fix -Wimplicit-int for ifsense + + fixes: + xmlif/xmlif.l:46:8: warning: type defaults to ‘int’ in declaration of ‘ifsense’ [-Wimplicit-int] + 46 | static ifsense; /* sense of last `if' or unless seen */ + | ^~~~~~~ + + Signed-off-by: Thomas Kuehne + +diff --git a/xmlif/xmlif.l b/xmlif/xmlif.l +index ac421367d47a2cd4..6e5970e147be21b1 100644 +--- a/xmlif/xmlif.l ++++ b/xmlif/xmlif.l +@@ -43,7 +43,7 @@ + + static char **selections; /* selection tokens */ + static int nselections; /* number of selections */ +-static ifsense; /* sense of last `if' or unless seen */ ++static int ifsense; /* sense of last `if' or unless seen */ + static char *attribute; /* last attribute scanned */ + + struct stack_t { diff --git a/xmlto-c99-2.patch b/xmlto-c99-2.patch new file mode 100644 index 0000000..0bdd32f --- /dev/null +++ b/xmlto-c99-2.patch @@ -0,0 +1,35 @@ +commit 8e34f087bf410bcc5fe445933d6ad9bae54f24b5 +Author: Thomas Kuehne +Date: Sat Dec 11 21:54:50 2021 +0100 + + Fix return type of main function + + Fixes: + xmlif/xmlif.l:242:1: warning: return type defaults to ‘int’ [-Wimplicit-int] + 242 | main(int argc, char *argv[]) + | ^~~~ + + Signed-off-by: Thomas Kuehne + +diff --git a/xmlif/xmlif.l b/xmlif/xmlif.l +index 6e5970e147be21b1..8bcc59216d41a3cb 100644 +--- a/xmlif/xmlif.l ++++ b/xmlif/xmlif.l +@@ -239,7 +239,7 @@ WS [ \t\n]* + + int yywrap() {exit(0);}; + +-main(int argc, char *argv[]) ++int main(int argc, char *argv[]) + { + int i; + +@@ -265,7 +265,7 @@ main(int argc, char *argv[]) + exit(1); + } + +- yylex(); ++ return yylex(); + } + + /* diff --git a/xmlto.spec b/xmlto.spec index f984702..e7423a0 100644 --- a/xmlto.spec +++ b/xmlto.spec @@ -1,7 +1,7 @@ -%define anolis_release 9 +%define anolis_release 10 Summary: A tool for converting XML files to various formats Name: xmlto -Version: 0.0.28 +Version: 0.0.28 Release: %{anolis_release}%{?dist} License: GPLv2+ Group: Applications/System @@ -9,11 +9,15 @@ Group: Applications/System #URL: http://cyberelk.net/tim/xmlto/ #Source0: http://cyberelk.net/tim/data/xmlto/stable/%{name}-%{version}.tar.bz2 URL: https://pagure.io/xmlto/ -Source0: http://releases.pagure.org/%{name}/%{name}-%{version}.tar.bz2 +Source0: https://releases.pagure.org/xmlto/xmlto-0.0.28.tar.bz2 +Patch1: xmlto-c99-2.patch +Patch2: xmlto-c99-1.patch BuildRequires: docbook-xsl BuildRequires: libxslt BuildRequires: util-linux, flex +BuildRequires: gcc +BuildRequires: make # We rely heavily on the DocBook XSL stylesheets! Requires: docbook-xsl @@ -103,6 +107,9 @@ Doc pages for %{name}. %doc ChangeLog README AUTHORS NEWS %changelog +* Mon Sep 29 2025 wenyuzifang - 0.0.28-10 +- Fix compiler warning by explicitly declaring main's return type and ensure proper exit status propagation +- Apply patch to eliminate compiler warnings, improve code clarity, and ensure strict C standard compliance * Wed May 21 2025 zhoujiajia111 - 0.0.28-9 - Rebuild for remove inappropriate build dependencies. -- Gitee