After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 331636 - Build from CVS fails on AMD64 due to format string problem.
Build from CVS fails on AMD64 due to format string problem.
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
0.x.x [obsolete]
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-18 06:00 UTC by James Henstridge
Modified: 2006-02-21 22:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description James Henstridge 2006-02-18 06:00: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.
Comment 1 Martin Wehner 2006-02-21 22:48:19 UTC
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.