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 645838 - Delegate with 'out' argument generates incorrect C code
Delegate with 'out' argument generates incorrect C code
Status: RESOLVED DUPLICATE of bug 622570
Product: vala
Classification: Core
Component: Delegates
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-27 17:07 UTC by Jim Peters
Modified: 2011-05-11 09:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jim Peters 2011-03-27 17:07:49 UTC
This code:

  [CCode (has_target = false)]
  public delegate bool SourcePrepareFunc (Source source, out int timeout_);

  public void main() {
     SourcePrepareFunc spf = (src, timeout) => {
        timeout = 0;
        return true;
     };
  }

when built with valac 0.11.7 gives:

  bug03.vala:5.22-8.4: warning: local variable `spf' declared but never used
  /w2/v/cwrk/vala/uazu/bug03.vala.c: In function '__lambda0__source_prepare_func':
  /w2/v/cwrk/vala/uazu/bug03.vala.c:28: warning: passing argument 2 of '_lambda0_' makes integer from
  pointer without a cast
  /w2/v/cwrk/vala/uazu/bug03.vala.c:17: note: expected 'gint' but argument is of type 'gint *'
  Compilation succeeded - 1 warning(s)

Part of the C code is expecting a gint for timeout and the other part a gint*.  Both should be gint*.
Comment 1 Luca Bruno 2011-05-11 09:54:54 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 622570 ***