Public bug reported:

Trying to use Posix.realpath with a code like:

    string tmp;
    tmp=Posix.realpath(this.config_path);

is compiled to:

    _tmp35_ = realpath (_tmp34_, NULL, 0);

which fails with error:

    .vala.c:920:2: error: too many argument for function ‘realpath’

because 'realpath' needs only two parameters, not three.

This error exists in both Vala 0.16 and 0.18.

The fix (pointed by Jonas Kulla) is to modify the prototype in
posix.vapi to:

    [CCode (cheader_filename = "stdlib.h")]
    public string? realpath (string path, [CCode (array_length=false)] uint8[]?
resolved_path = null);

This bug also applies to vala 0.16, so I will open a new bug report
there and attach the diff.

** Affects: vala-0.18 (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "posix.realpath.vala_0.18.diff"
   
https://bugs.launchpad.net/bugs/1154853/+attachment/3572932/+files/posix.realpath.vala_0.18.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1154853

Title:
   Posix.realpath has incorrect prototype

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/vala-0.18/+bug/1154853/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to