Re: xsok: FTBFS on armhf: showscore.c:75:15: error: passing argument 1 of ‘ctime’ from incompatible pointer type [-Wincompatible-pointer-types]
Le mer. 15 janv. 2025 à 20:59, Patrice Duroux
<patrice.duroux@gmail.com> a écrit :
>
> Source: xsok
> Followup-For: Bug #1091286
> Control: tags -1 patch ftbfs
>
> Hi,
>
> I made the attached small fix very simple to resolve the compilation error.
> But how do I test that it works correctly at runtime?
> The data array p[] is long integers and this represents data read from a
> file and I did not check how the data are coded when writing file content.
> My architecture is amd64 and is there a (Debian) tool/command to easily create
> an emulation environment to test the generated armhf package?
>
> Thanks,
> Patrice
diff --git a/debian/patches/series b/debian/patches/series
index 9c529de..ea31b90 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ no_gunzip.patch
security_paranoia.patch
do-not-use-global-variable-as-counter.patch
rootless.patch
+time64.patch
diff --git a/debian/patches/time64.patch b/debian/patches/time64.patch
new file mode 100644
index 0000000..4f1d637
--- /dev/null
+++ b/debian/patches/time64.patch
@@ -0,0 +1,11 @@
+--- a/src/showscore.c
++++ b/src/showscore.c
+@@ -72,7 +72,7 @@
+ filename = strrchr(filename, '/') + 1;
+ ReadHighscores(filename);
+
+- z = ctime(&p[4]);
++ z = ctime((const time_t *) &p[4]);
+ if (strchr(z, '\n'))
+ *strchr(z, '\n') = '\0';
+
Reply to: