From: Adam Borowski Date: Mon, 9 Mar 2015 06:58:10 +0000 (+0100) Subject: Fix a build failure on x32 (time_t printfs). X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=ffe0aa6a114e83649bb04ff8e09b8025be988de2;p=sgt-puzzles.git Fix a build failure on x32 (time_t printfs). As that architecture has 64-bit time_t but only 32-bit longs, printf format causes a warning. Enter -Werror... --- diff --git a/magnets.c b/magnets.c index 815f016..5437c61 100644 --- a/magnets.c +++ b/magnets.c @@ -2562,7 +2562,7 @@ int main(int argc, const char *argv[]) goto done; } s = new_game(NULL, p, desc); - printf("%s:%s (seed %ld)\n", id, desc, seed); + printf("%s:%s (seed %ld)\n", id, desc, (long)seed); if (aux) { /* We just generated this ourself. */ if (verbose || print) { diff --git a/signpost.c b/signpost.c index e89a7c6..5650b2b 100644 --- a/signpost.c +++ b/signpost.c @@ -2393,7 +2393,7 @@ int main(int argc, const char *argv[]) } } - sprintf(newseed, "%lu", time(NULL)); + sprintf(newseed, "%lu", (unsigned long) time(NULL)); seedstr = dupstr(newseed); if (id || !stdin_desc) {