[Issue 4199] D2 core.sys.posix.*: array parameters of C functions must be ref

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 17 06:17:04 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4199


Shin Fujishiro <rsinfu at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Other                       |All
            Summary|D2 core.sys.posix.setjmp    |D2 core.sys.posix.*: array
                   |segfaults                   |parameters of C functions
                   |                            |must be ref
         OS/Version|FreeBSD                     |All


--- Comment #1 from Shin Fujishiro <rsinfu at gmail.com> 2010-05-17 06:17:01 PDT ---
Hmm, the problem seems more generic.  More functions in core.sys.posix.* take
array parameters, and these are not ref-ed.  A good example is pipe():
--------------------
import std.stdio;
import core.sys.posix.unistd; // int pipe(int[2]);
void main() {
    int[2] pp;
    pipe(pp);
    writeln("Hello, world."); // not reached!
}
--------------------

The pipe() must be declared like: int pipe(ref int[2]).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list