Package: datefudge
Version: 1.23
Severity: important
Tags: patch upstream

datefudge fails to build from source with glibc 2.31

| gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 
-fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wall -Wextra -D_REENTRANT -fpic -c -o datefudge.o 
datefudge.c
| sed -e 's,@VERSION@,1.23,g; s,@MULTIARCH_PATTERN@,/*-*,g; 
s,@LIBDIR@,/usr/lib,g;' \
| < datefudge.man > datefudge.1
| datefudge.c:81:5: error: conflicting types for ‘gettimeofday’
|    81 | int gettimeofday(struct timeval *x, struct timezone *y) {
|       |     ^~~~~~~~~~~~
| In file included from datefudge.c:21:
| /usr/include/x86_64-linux-gnu/sys/time.h:66:12: note: previous declaration of 
‘gettimeofday’ was here
|    66 | extern int gettimeofday (struct timeval *__restrict __tv,
|       |            ^~~~~~~~~~~~
| make[1]: *** [Makefile:40: datefudge.o] Error 1
| make[1]: Leaving directory '/<<PKGBUILDDIR>>'
| dh_auto_build: error: make -j4 "INSTALL=install --strip-program=true" 
returned exit code 2
| make: *** [debian/rules:16: binary] Error 25
| dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 
2

The full build log is available there:
http://qa-logs.debian.net/2020/06/24/datefudge_1.23_unstable_glibc-exp.log

The support for timezones in gettimeofday has been removed in glibc
2.31. As a result the second argument of the gettimeofday prototype has
been changed from struct timezone * to void *. The same change needs to
be done in datefudge.

You will find attached a patch fixing that. It would be nice if it can
be fixed relatively soon so that we can start the transition.

Regards,
Aurelien
diff -Nru datefudge-1.23/datefudge.c datefudge-1.23/datefudge.c
--- datefudge-1.23/datefudge.c  2019-08-02 18:09:51.000000000 +0000
+++ datefudge-1.23/datefudge.c  2020-07-03 20:49:48.000000000 +0000
@@ -66,8 +66,8 @@
 
 #endif
 
-int __gettimeofday(struct timeval *x, struct timezone *y) {
-    static int (*libc_gettimeofday)(struct timeval *, struct timezone *) = 
NULL;
+int __gettimeofday(struct timeval *x, void *y) {
+    static int (*libc_gettimeofday)(struct timeval *, void *) = NULL;
     int res;
 
     if(!libc_gettimeofday)
@@ -78,7 +78,7 @@
     return 0;
 }
 
-int gettimeofday(struct timeval *x, struct timezone *y) {
+int gettimeofday(struct timeval *x, void *y) {
     return __gettimeofday(x,y);
 }
 

Reply via email to