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 618404 - Uses 32-bit x86 formatters for printing numeric values using printf, etc.
Uses 32-bit x86 formatters for printing numeric values using printf, etc.
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Basic Types
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 561692 618782 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-05-11 21:16 UTC by Julian Andres Klode
Modified: 2011-01-15 15:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch uses GLib FORMAT to fix format warnings (1.71 KB, patch)
2010-05-14 18:31 UTC, geert jordaens
none Details | Review

Description Julian Andres Klode 2010-05-11 21:16:46 UTC
For example, when doing:

      int64 int64_value = 1;
      int64_value.to_string();

This is what gcc outputs on AMD64 (with -Wall) :

warning: format ‘%lli’ expects type ‘long long int’, but argument 2 has type ‘gint64’


It would be good if vala could be changed to use the correct format strings for the target architecture instead of hardcoding the 32-bit x86 ones. This also breaks stuff like:
   
    print("%li", int64_value);

which results in Vala giving:
    error: Argument 2: Cannot convert from `int64' to `long'
        print("%li", int64_value);     
                     ^^^^^^^^^^^
although "%li" is the correct format for int64 on amd64 architecture.
Comment 1 geert jordaens 2010-05-14 18:31:48 UTC
Created attachment 161087 [details] [review]
Patch uses GLib FORMAT to fix format warnings
Comment 2 Luca Bruno 2010-07-29 23:12:36 UTC
*** Bug 561692 has been marked as a duplicate of this bug. ***
Comment 3 Evan Nemerson 2010-08-04 18:34:53 UTC
commit e87cb2aa84c8981b051507899c704c9f63b64c6f
Author: Geert Jordaens <geert.jordaens@telenet.be>
Date:   Wed Aug 4 11:33:02 2010 -0700

    glib-2.0: Use GLib FORMAT where possible to fix format warnings
    
    Fixes bug #618404.
Comment 4 Michael 'Mickey' Lauer 2011-01-15 15:14:03 UTC
*** Bug 618782 has been marked as a duplicate of this bug. ***