1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
Description: Align dlocaltime() declaration and remove redundant localtime()
Add #include <time.h> to tws.h to define time_t.
Update dlocaltime() prototype in tws.h to match implementation (const time_t *)
Remove conflicting declaration of localtime() in tws.c
Author: Leandro Cunha <leandrocunha016@gmail.com>
Bug-Debian: https://bugs.debian.org/1097624
From: Leandro Cunha <leandrocunha016@gmail.com>
Date: Wed, 2 Jul 2025 00:17:30 -0300
Subject: Fix FTBFS using GCC 15
Fix FTBFS with GCC 15: align dlocaltime() declaration and remove redundant localtime()
- Add #include <time.h> to tws.h to define time_t
- Update dlocaltime() prototype in tws.h to match implementation (const time_t *)
- Remove conflicting declaration of localtime() in tws.c
This fixes build errors with GCC 15 due to conflicting types and unknown time_t.
---
tws.c | 2 --
tws.h | 4 ++--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/tws.c b/tws.c
index 4e601d5..cdf44c5 100644
--- a/tws.c
+++ b/tws.c
@@ -37,8 +37,6 @@ extern long timezone;
#include <sys/timeb.h>
#endif /*SYS5*/
-struct tm* localtime();
-
struct tws *dtwstime()
{
time_t clock = 0;
diff --git a/tws.h b/tws.h
index 2d69b2f..7f2a388 100644
--- a/tws.h
+++ b/tws.h
@@ -2,7 +2,7 @@
/* Definition of the tws data structure. */
-
+#include <time.h>
#ifndef _TWS_H_
#define _TWS_H_ _TWS_H_
@@ -33,7 +33,7 @@ struct tws
/* Declarations of routines. */
-struct tws *dlocaltime( );
+struct tws *dlocaltime( const time_t * );
/* dlocaltime( &clock ) turns a time(3) clock value into a tws */
struct tws *dtwstime( );
|