Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
On Mon, 27 Oct 2014 03:07:12 + MachineCode via Digitalmars-d-learn wrote: > You're welcome :) what do you call git head is the dmd compiler > compiled from dmd's source code on github? yes. i'm updating my compiler on dayly basis, so my "git head" is really "head". ;-) but i also have alot

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread MachineCode via Digitalmars-d-learn
On Monday, 27 October 2014 at 02:27:32 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 27 Oct 2014 02:19:49 + MachineCode via Digitalmars-d-learn wrote: It worked fine for me. Output: > abc > abc Environment: Win 8.1 64-bit (but dmd target is 32-bit, IIRC), dmd v2.066.0 yes, thank

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
On Mon, 27 Oct 2014 02:25:50 +0200 ketmar via Digitalmars-d-learn wrote: for those who interested here is the patch that broke everything: https://github.com/D-Programming-Language/dmd/pull/3806/ i simply forgot that i included it for testing purposes, and it breaks something inside Phobos. si

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
On Mon, 27 Oct 2014 02:19:49 + MachineCode via Digitalmars-d-learn wrote: > It worked fine for me. Output: > > > abc > > abc > > Environment: Win 8.1 64-bit (but dmd target is 32-bit, IIRC), dmd > v2.066.0 yes, thank you too. that was one of my custom patches that broke this. i already fou

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread MachineCode via Digitalmars-d-learn
On Monday, 27 October 2014 at 00:26:00 UTC, ketmar via Digitalmars-d-learn wrote: Hello. let's assume we have this code: void doWrite(A...) (A args) { import std.stdio; import std.conv; writeln(to!string(args[0])); } void main () { char[3] a0 = "abc"; char[3] a1 = ['a

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
On Sun, 26 Oct 2014 17:41:28 -0700 Ali Çehreli via Digitalmars-d-learn wrote: > Yeah, works with git head. ah, thank you. seems that one of the custom patches i'm using broke that. i just checked this on unpatched DMD, and it works too. sorry for the noise. signature.asc Description: PGP signa

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread Ali Çehreli via Digitalmars-d-learn
On 10/26/2014 05:33 PM, anonymous wrote: On Monday, 27 October 2014 at 00:26:00 UTC, ketmar via Digitalmars-d-learn wrote: Hello. let's assume we have this code: void doWrite(A...) (A args) { import std.stdio; import std.conv; writeln(to!string(args[0])); } void main () {

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
On Mon, 27 Oct 2014 00:33:13 + anonymous via Digitalmars-d-learn wrote: > On Monday, 27 October 2014 at 00:26:00 UTC, ketmar via > Digitalmars-d-learn wrote: > > Hello. > > > > let's assume we have this code: > > > > void doWrite(A...) (A args) { > > import std.stdio; > > import std

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread anonymous via Digitalmars-d-learn
On Monday, 27 October 2014 at 00:26:00 UTC, ketmar via Digitalmars-d-learn wrote: Hello. let's assume we have this code: void doWrite(A...) (A args) { import std.stdio; import std.conv; writeln(to!string(args[0])); } void main () { char[3] a0 = "abc"; char[3] a1 = ['a

Re: passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
On Mon, 27 Oct 2014 02:25:50 +0200 ketmar via Digitalmars-d-learn wrote: p.s. i know how to block using non-dynamic arrays in this case, but i don't want to. i found this when writing writef-like function with CTFE parsing of formatting string and spent alot of time looking for bug in my code. ;-

passing non-dynamic arrays to variadic functions

2014-10-26 Thread ketmar via Digitalmars-d-learn
Hello. let's assume we have this code: void doWrite(A...) (A args) { import std.stdio; import std.conv; writeln(to!string(args[0])); } void main () { char[3] a0 = "abc"; char[3] a1 = ['a', 'b', 'c']; doWrite(a0); doWrite(a1); } i don't know why, but this code