d/patches: add patch to remove pre-ANSI function declarations

Pre-ANSI function declarators which do not declare their parameters have been
removed in C23 and the syntax reused for declaring functions with no parameters
(like C++).  GCC 15 defaults to C23, so these declarators will cause an FTBFS.

Update the function definitions to have ANSI prototypes where these are
missing, make them static and replace the obsolete declarations with modern
equivalents.

Closes: #1098100

Signed-off-by: Jeremy Sowden <azazel@debian.org>
This commit is contained in:
Jeremy Sowden
2025-02-27 19:18:41 +00:00
parent d5c2714eab
commit b0c2155db9
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,55 @@
Author: Jeremy Sowden <jeremy@azazel.net>
Last-Update: 2025-02-27
Bug-Debian: https://bugs.debian.org/1098100
Forwarded: yes
Applied-Upstream: commit:97d7faf9150414ddfc3a53cd9905e628dd60685f
Description: remove pre-ANSI function declarations
Pre-ANSI function declarators which do not declare their parameters have been
removed in C23 and the syntax reused for declaring functions with no parameters
(like C++). GCC 15 defaults to C23, so these declarators will cause an FTBFS.
.
Update the function definitions to have ANSI prototypes where these are
missing, make them static and replace the obsolete declarations with modern
equivalents.
--- a/Src/wmCalClock.c
+++ b/Src/wmCalClock.c
@@ -119,6 +119,8 @@
+static double jd(int ny, int nm, int nd, double UT);
+static double hour24(double hour);
void ParseCMDLine(int argc, char *argv[]);
void ButtonPressEvent(XButtonEvent *);
@@ -310,7 +312,7 @@
int Year, Month, DayOfWeek, DayOfMonth, OldDayOfMonth;
int Hours, Mins, Secs, OldSecs, digit, xoff, D[10], xsize;
time_t CurrentLocalTime;
- double UT, TU, TU2, TU3, T0, gmst, jd(), hour24();
+ double UT, TU, TU2, TU3, T0, gmst;
/*
@@ -939,9 +941,7 @@
* Compute the Julian Day number for the given date.
* Julian Date is the number of days since noon of Jan 1 4713 B.C.
*/
-double jd(ny, nm, nd, UT)
-int ny, nm, nd;
-double UT;
+static double jd(int ny, int nm, int nd, double UT)
{
double A, B, C, D, JD, day;
@@ -976,8 +976,7 @@
}
-double hour24(hour)
-double hour;
+static double hour24(double hour)
{
int n;

1
debian/patches/series vendored Normal file
View File

@ -0,0 +1 @@
01-fix-pre-ansi-function-declarations.patch