From b0c2155db9b3a5d295c4260a728dcf7df57cabfc Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Thu, 27 Feb 2025 19:18:41 +0000 Subject: [PATCH] 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 --- ...1-fix-pre-ansi-function-declarations.patch | 55 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 56 insertions(+) create mode 100644 debian/patches/01-fix-pre-ansi-function-declarations.patch create mode 100644 debian/patches/series diff --git a/debian/patches/01-fix-pre-ansi-function-declarations.patch b/debian/patches/01-fix-pre-ansi-function-declarations.patch new file mode 100644 index 0000000..f96891a --- /dev/null +++ b/debian/patches/01-fix-pre-ansi-function-declarations.patch @@ -0,0 +1,55 @@ +Author: Jeremy Sowden +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; + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..50e3424 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +01-fix-pre-ansi-function-declarations.patch