GNOME Bugzilla – Bug 331636
Build from CVS fails on AMD64 due to format string problem.
Last modified: 2006-02-21 22:48:19 UTC
When building out of CVS on AMD64, the build fails on libnautilus-private/nautilus-file.c due to a format string used to display a GnomeVFSFileSize value. The format string reads "%s (%lld butes)", while a GnomeVFSFileSize is a long. The following patch corrects the problem, but will screw up translations due to xgettext not recognising the GNOME_VFS_SIZE_FORMAT_STR constant: Index: libnautilus-private/nautilus-file.c =================================================================== RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v retrieving revision 1.380 diff -u -p -r1.380 nautilus-file.c --- libnautilus-private/nautilus-file.c 28 Jan 2006 14:55:08 -0000 1.380 +++ libnautilus-private/nautilus-file.c 18 Feb 2006 05:45:25 -0000 @@ -4353,7 +4353,7 @@ nautilus_file_get_size_as_string_with_re } formated = gnome_vfs_format_file_size_for_display (file->details->info->size); - formated_plus_real = g_strdup_printf (_("%s (%lld bytes)"), formated, file->details->info->size); + formated_plus_real = g_strdup_printf (_("%s (%"GNOME_VFS_SIZE_FORMAT_STR" bytes)"), formated, file->details->info->size); g_free (formated); return formated_plus_real; } The alternative (short of disabling -Werror) would be to format the file size separately, and then substitute it in with a %s.
Oops. I added a cast for now to avoid a string freeze break but added a FIXME that we should use GNOME_VFS_SIZE_FORMAT_STR in the future. 2006-02-21 Martin Wehner <martin.wehner@gmail.com> * libnautilus-private/nautilus-file.c: (nautilus_file_get_size_as_string_with_real_size): Add a cast to fix build for platforms where GnomeVFSFileSize is not defined as long long (e.g. AMD64). Fixes bug #331636.