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 749652 - compilation errors with gcc 4.8
compilation errors with gcc 4.8
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.44.x
Other Solaris
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-05-20 17:53 UTC by Shawn Walker
Modified: 2017-11-28 14:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio: Add some casts for printf() formatting statbufs on Solaris (3.04 KB, patch)
2017-11-17 14:25 UTC, Philip Withnall
committed Details | Review

Description Shawn Walker 2015-05-20 17:53:03 UTC
/builds/glib2/glib-2.44.1/gio/gdbusauthmechanismsha1.c: In function 'ensure_keyring_directory':
/builds/glib2/glib-2.44.1/gio/gdbusauthmechanismsha1.c:275:28: error: format '%o' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Werror=format=]
                            statbuf.st_mode & 0777);
                            ^
  CC       libgio_2_0_la-gdbusmessage.lo
/builds/glib2/glib-2.44.1/gio/gdbusmessage.c: In function 'g_dbus_message_print':
/builds/glib2/glib-2.44.1/gio/gdbusmessage.c:3475:43: error: format '%d' expects argument of type 'int', but argument 4 has type 'major_t' [-Werror=format=]
                                           major (statbuf.st_dev), minor (statbuf.st_dev));
                                           ^
/builds/glib2/glib-2.44.1/gio/gdbusmessage.c:3475:43: error: format '%d' expects argument of type 'int', but argument 5 has type 'minor_t' [-Werror=format=]
/builds/glib2/glib-2.44.1/gio/gdbusmessage.c:3477:43: error: format '%o' expects argument of type 'unsigned int', but argument 4 has type 'mode_t' [-Werror=format=]
                                           statbuf.st_mode);
                                           ^
/builds/glib2/glib-2.44.1/gio/gdbusmessage.c:3485:43: error: format '%d' expects argument of type 'int', but argument 4 has type 'major_t' [-Werror=format=]
                                           major (statbuf.st_rdev), minor (statbuf.st_rdev));
                                           ^
/builds/glib2/glib-2.44.1/gio/gdbusmessage.c:3485:43: error: format '%d' expects argument of type 'int', but argument 5 has type 'minor_t' [-Werror=format=]
cc1: some warnings being treated as errors
Comment 1 Philip Withnall 2017-11-17 14:25:14 UTC
Created attachment 363930 [details] [review]
gio: Add some casts for printf() formatting statbufs on Solaris

Apparently Solaris defines statbuf fields as long when Linux doesn’t, in
some cases. Cast down to the type expected by the printf() format
placeholder.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Emmanuele Bassi (:ebassi) 2017-11-28 12:36:38 UTC
Review of attachment 363930 [details] [review]:

Every time I see a cast to (gint), I get a vague twitch in my left eye.
Comment 3 Philip Withnall 2017-11-28 14:17:33 UTC
Attachment 363930 [details] pushed as e644bfa - gio: Add some casts for printf() formatting statbufs on Solaris