[Issue 3604] extern(C) callable function with array parameters broken
https://issues.dlang.org/show_bug.cgi?id=3604 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Version|2.037 |D2 --
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Comment #12 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-13 01:55:00 PDT --- Fixed DMD 2.048. http://www.dsource.org/projects/druntime/changeset/336 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 Brad Roberts bra...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED CC||bra...@puremagic.com Resolution||FIXED --- Comment #10 from Brad Roberts bra...@puremagic.com 2010-06-15 02:09:04 PDT --- fixed in 2.047 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | --- Comment #11 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-06-15 04:47:33 PDT --- It seems only the ones in stdlib and unistd have been fixed, and not the ones in sys.socket and sys.time. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 --- Comment #7 from Witold Baryluk bary...@smp.if.uj.edu.pl 2010-01-21 05:44:35 PST --- Thanks. Functions like sys.posix.unistd: pipe, encrypt sys.posix.stdlib: Xseed48, {e,j,n}rand48, lcong48 sys.posix.poll: poll sys.posix.sys.time: utimes sys.posix.sys.socket : socketpair are currently affected in druntime (from 2.039). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #6 from Walter Bright bugzi...@digitalmars.com 2010-01-04 14:47:18 PST --- Good idea, I've updated interfaceToC.html -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 Witold Baryluk bary...@smp.if.uj.edu.pl changed: What|Removed |Added Platform|Other |x86 --- Comment #1 from Witold Baryluk bary...@smp.if.uj.edu.pl 2009-12-10 10:31:47 PST --- In, 2.032 (just tested) it returns: $ ./bug3604 input: 0 0 input.ptr: BFA00CB8 cast input: BFA00CB8 x = 0 0 x[0] = 0 x[1] = 0 ok $ So not exactly what I written, but pipe is working. So i tested it more precisly: bug3604.d: extern(C) int tttc(int[2] x); void main() { int[2] input; tttc(input); } bug3604c.c: #include stdio.h int tttc(int x[2]) { printf(just in C\n); printf(x=%p\n, x); printf(x[0]=%d\n, x[0]); printf(x[1]=%d\n, x[1]); printf(back from C\n); } # gcc -c bug3604c.c # dmd2.032 bug3604.d bug3604c.o # ./bug3604 just in C x=0xbf988ff8 x[0]=0 x[1]=0 back from C # dmd2.037 bug3604.d bug3604c.o # ./bug3604 just in C x=(nil) Segmentation fault # So it is regression. In `strace` for pipe example I see for 2.032: pipe([3, 4])= 0 and for 2.037: pipe(0) = -1 EFAULT (Bad address) So it also passes NULL pointer (jiust like in tttc function) . -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3604] extern(C) callable function with array parameters broken
http://d.puremagic.com/issues/show_bug.cgi?id=3604 Lutger lutger.blijdest...@gmail.com changed: What|Removed |Added CC||lutger.blijdest...@gmail.co ||m --- Comment #2 from Lutger lutger.blijdest...@gmail.com 2009-12-10 13:36:16 PST --- This is not a compiler bug, but due to the changed semantics (value instead of reference) of static arrays the extern(C) declaration of pipe is wrong. See also this post: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learnarticle_id=18393 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---