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 732530 - vala fails to detect format string errors when instantiating an error
vala fails to detect format string errors when instantiating an error
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GError
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-01 00:45 UTC by Evan Nemerson
Modified: 2014-07-08 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Detect format string errors when instancing an error (11.56 KB, patch)
2014-07-06 17:40 UTC, Simon Werbeck
none Details | Review

Description Evan Nemerson 2014-07-01 00:45:43 UTC
Given the following:


  public errordomain Foo {
    BAR
  }

  private static int main (string[] args) {
    try {
      throw new Foo.BAR ("Hello, %s", 1729);
    } catch (GLib.Error e) {
      GLib.error (e.message);
    }

    return 0;
  }


Vala should emit an error message about "Cannot convert from `int' to `string'".  It doesn't.
Comment 1 Simon Werbeck 2014-07-06 17:40:24 UTC
Created attachment 280007 [details] [review]
Detect format string errors when instancing an error

Fixes bug 732530
Comment 2 Luca Bruno 2014-07-07 12:27:35 UTC
commit 7b6ee1be1e6b958a71911a6d5f5040e385a96a84
Author: Simon Werbeck <simon.werbeck@gmail.com>
Date:   Sun Jul 6 19:18:16 2014 +0200

    Detect format string errors when instancing errors
    
    Fixes bug 732530

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.