- Upstream patches
* cross compile build of 3.12 diffutils fails * sdiff: continue → break * sdiff: pacify gcc -flto -Wmaybe-uninitialized * sdiff: port back to C17
This commit is contained in:
parent
3ef05884d7
commit
f07f8c37a4
5 changed files with 223 additions and 2 deletions
85
0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch
Normal file
85
0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
From 45a4762bf3241e7fb6a2e01d382791ae44236841 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Wed, 23 Apr 2025 11:34:20 -0700
|
||||
Subject: [PATCH] sdiff: pacify gcc -flto -Wmaybe-uninitialized
|
||||
|
||||
* src/sdiff.c (edit): Portmanteauize two locals into one, which
|
||||
arguably makes the code clearer, and anyway pacifies gcc -flto
|
||||
-Wmaybe-uninitialized with gcc (GCC) 15.0.1 20250329 (Red Hat
|
||||
15.0.1-0) x86-64 (Bug#78019).
|
||||
---
|
||||
src/sdiff.c | 19 +++++++++++--------
|
||||
1 file changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/sdiff.c b/src/sdiff.c
|
||||
index 5b1b162..15b8dce 100644
|
||||
--- a/src/sdiff.c
|
||||
+++ b/src/sdiff.c
|
||||
@@ -857,8 +857,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
- int cmd0;
|
||||
- int cmd1;
|
||||
+ int cmd;
|
||||
bool gotcmd = false;
|
||||
|
||||
while (! gotcmd)
|
||||
@@ -867,8 +866,8 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
perror_fatal (_("write failed"));
|
||||
ck_fflush (stdout);
|
||||
|
||||
- cmd0 = skip_white ();
|
||||
- switch (cmd0)
|
||||
+ cmd = skip_white ();
|
||||
+ switch (cmd)
|
||||
{
|
||||
case '1': case '2': case 'l': case 'r':
|
||||
case 's': case 'v': case 'q':
|
||||
@@ -882,12 +881,15 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
- cmd1 = skip_white ();
|
||||
+ int cmd1 = skip_white ();
|
||||
switch (cmd1)
|
||||
{
|
||||
case '1': case '2': case 'b': case 'd': case 'l': case 'r':
|
||||
if (skip_white () == '\n')
|
||||
- gotcmd = true;
|
||||
+ {
|
||||
+ gotcmd = true;
|
||||
+ cmd |= cmd1 << UCHAR_WIDTH;
|
||||
+ }
|
||||
else
|
||||
{
|
||||
give_help ();
|
||||
@@ -908,7 +910,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
if (feof (stdin))
|
||||
{
|
||||
gotcmd = true;
|
||||
- cmd0 = 'q';
|
||||
+ cmd = 'q';
|
||||
break;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
@@ -921,7 +923,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
}
|
||||
}
|
||||
|
||||
- switch (cmd0)
|
||||
+ switch (cmd & UCHAR_MAX)
|
||||
{
|
||||
case '1': case 'l':
|
||||
lf_copy (left, llen, outfile);
|
||||
@@ -954,6 +956,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
if (! tmp)
|
||||
perror_fatal (squote (0, tmpname));
|
||||
|
||||
+ int cmd1 = cmd >> UCHAR_WIDTH;
|
||||
switch (cmd1)
|
||||
{
|
||||
case 'd':
|
||||
--
|
||||
2.48.1
|
||||
|
||||
27
0001-sdiff-port-back-to-C17.patch
Normal file
27
0001-sdiff-port-back-to-C17.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
From 686357a40ca038edc902276cb3b33f4757d8cfb2 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Sat, 26 Apr 2025 12:54:06 -0700
|
||||
Subject: [PATCH] sdiff: port back to C17-
|
||||
|
||||
* src/sdiff.c (edit): Do not use a label just before a statement.
|
||||
Problem reported by Bruno Haible (Bug#78032).
|
||||
---
|
||||
src/sdiff.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/sdiff.c b/src/sdiff.c
|
||||
index 15b8dce..cc961c3 100644
|
||||
--- a/src/sdiff.c
|
||||
+++ b/src/sdiff.c
|
||||
@@ -880,7 +880,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
}
|
||||
break;
|
||||
|
||||
- case 'e':
|
||||
+ case 'e':;
|
||||
int cmd1 = skip_white ();
|
||||
switch (cmd1)
|
||||
{
|
||||
--
|
||||
2.48.1
|
||||
|
||||
30
diffutils-3.12-cross-compiler-build-fail.patch
Normal file
30
diffutils-3.12-cross-compiler-build-fail.patch
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
From d9083a4cc638cf9c7dfc3cc534a7c6b4debf50ab Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Haible <bruno@clisp.org>
|
||||
Date: Thu, 10 Apr 2025 16:42:14 +0200
|
||||
Subject: strcasecmp: Support cross-compilation.
|
||||
|
||||
Reported by Rudi Heitbaum <rudi@heitbaum.com> in
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00055.html>.
|
||||
|
||||
diff --git a/m4/strcasecmp.m4 b/m4/strcasecmp.m4
|
||||
index e40ee5d..eb4345d 100644
|
||||
--- a/m4/strcasecmp.m4
|
||||
+++ b/m4/strcasecmp.m4
|
||||
@@ -1,5 +1,5 @@
|
||||
# strcasecmp.m4
|
||||
-# serial 2
|
||||
+# serial 3
|
||||
dnl Copyright (C) 2002-2025 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
@@ -57,7 +57,7 @@ int main ()
|
||||
gl_cv_func_strcasecmp_works=no
|
||||
fi
|
||||
],
|
||||
- [])
|
||||
+ [:])
|
||||
])
|
||||
])
|
||||
|
||||
--
|
||||
cgit v1.1
|
||||
65
diffutils-3.12-sdiff-continue-break.patch
Normal file
65
diffutils-3.12-sdiff-continue-break.patch
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
commit 80053ab7b57c1f0825deb4a22018dacfa62d7272
|
||||
Author: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Wed Apr 23 11:17:53 2025 -0700
|
||||
|
||||
sdiff: continue → break
|
||||
|
||||
* src/sdiff.c (edit): Don’t use ‘continue’ when a simple
|
||||
break from the switch will do.
|
||||
|
||||
diff --git a/src/sdiff.c b/src/sdiff.c
|
||||
index 7734a82..5b1b162 100644
|
||||
--- a/src/sdiff.c
|
||||
+++ b/src/sdiff.c
|
||||
@@ -872,13 +872,13 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
{
|
||||
case '1': case '2': case 'l': case 'r':
|
||||
case 's': case 'v': case 'q':
|
||||
- if (skip_white () != '\n')
|
||||
+ if (skip_white () == '\n')
|
||||
+ gotcmd = true;
|
||||
+ else
|
||||
{
|
||||
give_help ();
|
||||
flush_line ();
|
||||
- continue;
|
||||
}
|
||||
- gotcmd = true;
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
@@ -886,13 +886,13 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
switch (cmd1)
|
||||
{
|
||||
case '1': case '2': case 'b': case 'd': case 'l': case 'r':
|
||||
- if (skip_white () != '\n')
|
||||
+ if (skip_white () == '\n')
|
||||
+ gotcmd = true;
|
||||
+ else
|
||||
{
|
||||
give_help ();
|
||||
flush_line ();
|
||||
- continue;
|
||||
}
|
||||
- gotcmd = true;
|
||||
break;
|
||||
case '\n':
|
||||
gotcmd = true;
|
||||
@@ -900,7 +900,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
default:
|
||||
give_help ();
|
||||
flush_line ();
|
||||
- continue;
|
||||
+ break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -917,7 +917,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
|
||||
FALLTHROUGH;
|
||||
case '\n':
|
||||
give_help ();
|
||||
- continue;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,11 +1,18 @@
|
|||
Summary: GNU collection of diff utilities
|
||||
Name: diffutils
|
||||
Version: 3.12
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
URL: https://www.gnu.org/software/diffutils/diffutils.html
|
||||
Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
|
||||
# upstream fixes
|
||||
|
||||
# cross compile build of 3.12 diffutils fails
|
||||
Patch: diffutils-3.12-cross-compiler-build-fail.patch
|
||||
# sdiff: continue → break
|
||||
Patch: diffutils-3.12-sdiff-continue-break.patch
|
||||
# sdiff: pacify gcc -flto -Wmaybe-uninitialized
|
||||
Patch: 0001-sdiff-pacify-gcc-flto-Wmaybe-uninitialized.patch
|
||||
# sdiff: port back to C17
|
||||
Patch: 0001-sdiff-port-back-to-C17.patch
|
||||
License: GPL-3.0-or-later
|
||||
Provides: bundled(gnulib)
|
||||
BuildRequires: gcc
|
||||
|
|
@ -55,6 +62,13 @@ make check
|
|||
%{_infodir}/diffutils.info*
|
||||
|
||||
%changelog
|
||||
* Mon May 05 2025 Than Ngo <than@redhat.com> - 3.12-2
|
||||
- Upstream patches
|
||||
* cross compile build of 3.12 diffutils fails
|
||||
* sdiff: continue → break
|
||||
* sdiff: pacify gcc -flto -Wmaybe-uninitialized
|
||||
* sdiff: port back to C17
|
||||
|
||||
* Fri Apr 11 2025 Than Ngo <than@redhat.com> - 3.12-1
|
||||
- Fixed rhbz#2358545, Update to 3.12
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue