On Mon, Dec 23, 2024 at 06:33:56PM +0100, Lucas Nussbaum wrote:
> Source: yagiuda
> Version: 1.19-11
> Severity: serious
> Justification: FTBFS
> Tags: trixie sid ftbfs
> User: lu...@debian.org
> Usertags: ftbfs-20241223 ftbfs-trixie
> 
> > random.c: In function ‘seedRNG’:
> > random.c:84:14: error: passing argument 1 of ‘time’ from incompatible 
> > pointer type [-Wincompatible-pointer-types]
> >    84 |         time(&seed_time); /* set seed_time to the number of seconds 
> > since Jan 1980 */
> >       |              ^~~~~~~~~~
> >       |              |
> >       |              long int *
> > In file included from /usr/include/features.h:510,
> >                  from 
> > /usr/include/arm-linux-gnueabihf/bits/libc-header-start.h:33,
> >                  from /usr/include/stdlib.h:26,
> >                  from random.c:2:
> > /usr/include/time.h:85:15: note: expected ‘time_t *’ {aka ‘long long int 
> > *’} but argument is of type ‘long int *’
> >    85 | extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
> >       |               ^~~~~~~~~~~~~~
> > make[2]: *** [Makefile:615: random.o] Error 1

Attached is a patch that simplifies the seeding of srand48().

Dave, if you'd like, I can go ahead and prepare an updated package.

The only reason I didn't go ahead and do so is because I noticed that
a minor difference between what's in the source package in the archive
and what's in the Salsa repo, and I didn't want to create a 3-way merge
in case you have other work in progess.

I suspect there is one missing commit (plus the tag for debian/1.19-11)
that needs to be pushed to Salsa.  Specifically, the source package
doesn't contain the file .gitignore, which appears was accidentally
added in commit 47224e3868f6e2e845a024b9343ed35d01195ec0.  If you would
like to push your commit and the tag, please do.  Otherwise, I'll use
the commit and tag created by `gbp import-dsc` for the -11 revision and
push that.

Thanks,
tony
Index: yagiuda/src/random.c
===================================================================
--- yagiuda.orig/src/random.c
+++ yagiuda/src/random.c
@@ -79,10 +79,5 @@ int randint(void)
 usually necessary to seed both sepparately */
 void seedRNG(void)
 {
-	long seed_time;
-
-	time(&seed_time); /* set seed_time to the number of seconds since Jan 1980 */
-
-	srand48(seed_time);  /* Seed the float type */
-
+	srand48((long)time(NULL));  /* Seed the float type */
 }

Attachment: signature.asc
Description: PGP signature

Reply via email to