GNOME Bugzilla – Bug 586346
build failure: snprintf with wrong type: libnautilus-private/nautilus-{,meta}file.c
Last modified: 2009-06-23 01:39:06 UTC
git revision: 66b53e8 With -Werror set, the build of Nautilus fails on FreeBSD 7.2-RELEASE due to an incorrect argument type to snprintf() at line 3209 of libnautilus-private/nautilus-file.c Making all in libnautilus-private CC nautilus-file.o cc1: warnings being treated as errors nautilus-file.c: In function 'nautilus_file_set_time_metadata': nautilus-file.c:3209: warning: format '%ld' expects type 'long int', but argument 4 has type 'time_t' nautilus-file.c:3209: warning: format '%ld' expects type 'long int', but argument 4 has type 'time_t' gmake[2]: *** [nautilus-file.lo] Error 1 gmake[1]: *** [all-recursive] Error 1 gmake: *** [all] Error 2 uname: FreeBSD musdea.ucc.gu.uwa.edu.au 7.2-RELEASE-p1 FreeBSD 7.2-RELEASE-p1 #0: Tue Jun 9 21:30:43 UTC 2009 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 gcc: Using built-in specs. Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD]
Used g_snprintf() instead of snprintf(). Fixed in HEAD. Thanks for reporting.
Whoops - a similar change required in nautilus-metafile.c, at line 887: - snprintf (time_str, 20, "%ld", time (NULL)); + g_snprintf (time_str, 20, "%ld", (long int)time (NULL)); does the job.
Done and done. Thanks again.