Re: [Issue 10108] Thread local slice to array literal references the same data
On Sat, 18 May 2013 16:59:53 +0200, Sean Kelly s...@invisibleduck.org wrote: This is expected because the global is __gshared and there's therefore no type protection from doing this. If you want safe sharing, make the global shared. [snip] __gshared int[] gArr = [1,2,3]; int[] arr = gArr; Uhm, you are aware this is the Bugzilla newsgroup, right? Please reply in Bugzilla. Also, that's exactly what we're saying. This code has problems: import core.thread; int[] arr = [1,2,3]; void main() { new Thread({arr[0] = 3;}); assert(arr[0] == 1); } And they are caused by the data inside arr being shared. This is unsafe, unexpected (due to safety of other globals) and, we feel, goes against the D ethos. -- Simen
Re: Problem with stdlib.d
On Sun, 05 Aug 2012 16:53:24 +0200, constantine kostas...@yahoo.gr wrote: I try to use DSMFL to learn about game programming and I got this error. D:\Programming\DSFML\samples\dsfmldsss build pong\pong.d = bin/pong ../../import\dsfml\system\alloc.d(9): module stdlib cannot read file 'std\c\stdl ib.d' Command D:\Programming\Tools\dsss\bin\rebuild.exe returned with code 1, aborting . Error: Command failed, aborting. As far as I know the file is located here in my hard drive D:\Program Files\D\dmd2\src\phobos\std\c P.S. I think that there could be the space between Program Files, just as right 10 minutes ago I had the same program with DSSS, due to a space in the filename. But I need to investigate it first and I'll be back. This newsgroup is for automated posts from Bugzilla only. Please move your discussion to digitalmars.D.learn. -- Simen
Re: A bug with DMD 2.054
On Fri, 15 Jul 2011 12:32:05 +0200, BizarreCake bizarrec...@gmail.com wrote: While coding, I've stumbled upon this weird bug. Apparently, this code snippet right here: module program; import std.stdio; class Foo { void bar() { writeln( Foo Bar! ); } } void main() { new Foo().bar(); } Doesn't work. It outputs the following error: program.d(12): found '.' when expecting ';' following statement Line 12 is: new Foo().bar(); This newsfroup is for automated posts by the BugZilla issue-tracker system. If you want to file a bug, please visit http://d.puremagic.com/issues/ or discuss your find in digitalmars.D.learn. As for your actual problem, thinks are working as intended. The compiler believes you wanted to write new (Foo().bar()); whereas you more likely meant (new Foo()).bar(); -- Simen
Re: Language Reference: Usual Arithmetic Conversions
On Tue, 05 Apr 2011 20:10:19 +0200, Morlan h...@valentimex.com wrote: The following section from the Language Reference does not correspond to the current dmd compiler (v2.052, Windows) behaviour: Integer values cannot be implicitly converted to another type that cannot represent the integer bit pattern after integral promotion. For example: ubyte u1 = cast(byte)-1; // error, -1 cannot be represented in a ubyte ushort u2 = cast(short)-1; // error, -1 cannot be represented in a ushort uint u3 = cast(int)-1;// ok, -1 can be represented in a uint ulong u4 = cast(ulong)-1; // ok, -1 can be represented in a ulong Both byte and short casts work all right. Please use bugzilla to file issues: http://d.puremagic.com/issues/enter_bug.cgi -- Simen
Re: Language Reference
On Tue, 05 Apr 2011 20:04:43 +0200, Morlan h...@valentimex.com wrote: After clicking on Template in the left menu of Language Reference on http://d-programming-language.org/ page, the menu collapses to start menu, while for other items it remains visible. Please use bugzilla to file issues: http://d.puremagic.com/issues/enter_bug.cgi -- Simen
Re: datetime fails with undefined reference
Kai Meyer k...@fiber.net wrote: I can import std.datetime, but when I try to use Ticks, or build the unittest, I get undefined reference issues with the Posix time libraries. Fedora 14, dmd-2.051-0.i386.rpm [kai@worky ~]$ dmd -unittest /usr/include/d/dmd/phobos/std/datetime.d datetime.o: In function `_D3std8datetime5Ticks12_staticCtor1OFNeZv': /usr/include/d/dmd/phobos/std/datetime.d:(.text._D3std8datetime5Ticks12_staticCtor1OFNeZv+0x14): undefined reference to `clock_getres' datetime.o: In function `_D3std8datetime7systimeFNeZS3std8datetime5Ticks': /usr/include/d/dmd/phobos/std/datetime.d:(.text._D3std8datetime7systimeFNeZS3std8datetime5Ticks+0x14): undefined reference to `clock_gettime' /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(dmain2_517_1a5.o): In function `_D2rt6dmain24mainUiPPaZi7runMainMFZv': src/rt/dmain2.d:(.text._D2rt6dmain24mainUiPPaZi7runMainMFZv+0x16): undefined reference to `_Dmain' /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(deh2_4e7_525.o): In function `_D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable': src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x4): undefined reference to `_deh_beg' src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0xc): undefined reference to `_deh_beg' src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x13): undefined reference to `_deh_end' src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x37): undefined reference to `_deh_end' /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(thread_eb_258.o): In function `_D4core6thread6Thread6__ctorMFZC4core6thread6Thread': src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x1d): undefined reference to `_tlsend' src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x24): undefined reference to `_tlsstart' /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(thread_ee_6e4.o): In function `thread_attachThis': src/core/thread.d:(.text.thread_attachThis+0x53): undefined reference to `_tlsstart' src/core/thread.d:(.text.thread_attachThis+0x5c): undefined reference to `_tlsend' /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(thread_e8_713.o): In function `thread_entryPoint': src/core/thread.d:(.text.thread_entryPoint+0x29): undefined reference to `_tlsend' src/core/thread.d:(.text.thread_entryPoint+0x2f): undefined reference to `_tlsstart' collect2: ld returned 1 exit status --- errorlevel 1 This newsgroup is for automated posts by Bugzilla. You should probably post in digitalmars.D.learn instead. -- Simen
Re: GC.collect() and GC.minimize() not releasing memory
Stewart Gordon smjg_1...@yahoo.com wrote: On 24/12/2010 06:13, torhu wrote: This newsgroup is just for automated use by Bugzilla. snip Where is the official statement of this? Likely there is no hard official statement. However, http://www.digitalmars.com/NewsGroup.html states that it is for Bug reports for D compiler and library. Those use Bugzilla for bug reports, and free-floating posts in the newsgroup are not tracked like those in Bugzilla, giving them a lot less value. -- Simen
Re: GC.collect() and GC.minimize() not releasing memory
Walter Bright newshou...@digitalmars.com wrote: Simen kjaeraas wrote: Stewart Gordon smjg_1...@yahoo.com wrote: On 24/12/2010 06:13, torhu wrote: This newsgroup is just for automated use by Bugzilla. snip Where is the official statement of this? Likely there is no hard official statement. However, http://www.digitalmars.com/NewsGroup.html states that it is for Bug reports for D compiler and library. Those use Bugzilla for bug reports, and free-floating posts in the newsgroup are not tracked like those in Bugzilla, giving them a lot less value. That's right. It's just not useful to post free floating posts here. Bug reports should go in bugzilla. And right there is your official statement^ :p -- Simen
Re: @safe functions
Sean Eskapp eatingstap...@gmail.com wrote: This is either a compiler bug, or outdated language documentation, but I'm having some freedom with @safe functions: * No casting from a pointer type to any type other than void*. * No modification of pointer values. * No taking the address of a local variable or function parameter. I've attached code which does all three of these things, which compiles and runs. Inline assembler was an error, as well as casting from integer to a pointer type, but I didn't test anything else. I'm using dmd2.exe as my compiler. Safe-D is currently not implemented, at least in whole. Other issues also have higher priority. Also, this group is for automated messages from BugZilla. Please either post these things as bugs[1] or in the digitalmars.D.learn of digitalmars.D newsgroups. [1]: http://d.puremagic.com/issues/enter_bug.cgi -- Simen
Re: Version (X86_64) for struct_stat64 on Linux x86_64
Chuck Blake c...@mit.edu wrote: Hi. I realize that 64-bit phobos is relatively work in progress. I thought I'd contribute. struct_stat64 is broken on Linux x86_64 which further breaks an awful lot of file IO. I have a small patch that fixes it. I tested this with gdc 2.051 within gcc-4.5.2, with an attached program and comparing to the output from the 'stat' utility. It is so basic and logic-free that I seriously doubt environmental considerations matter. This doesn't completely fix file IO, but it at least gives it a running chance. I can read files under 8MB, for example. :) This is an automated newsgroup. Please post to digitalmars.D or digitalmars.D.learn, or file your issue in BugZilla. For this specific problem, you might also consider joining the Phobos mailing list at http://lists.puremagic.com/mailman/listinfo/ -- Simen
Re: Interface inheritance
Mandeep Singh Brar mand...@brars.co.in wrote: The following code does not compile. import std.stdio; interface A { public void a(int l); } class ACl:A { public void a(int l) { writeln(Hello a); } } interface B: A { public void a(string l, int k); } class BCl: ACl, B { public void a(string l, int k) { writeln(Hello B.a, l, k); } } int main() { B b = new BCl(); b.a(1); return 0; } However casting B to A like (cast(A)b).a(1); makes it work. Regards Mandeep http://d.puremagic.com/issues/enter_bug.cgi Please file the bug here. -- Simen
Re: DMD1 function template broken or did I f.u.?
0ffh fr...@youknow.what.todo.internetz wrote: So, my question is: Huh? The answer to this should for symmetry be: Duh! However, it is not quite that simple. void remove(T)(out T[] array,T element) { This is the line that gives you problems. You are expecting 'out' to work like 'ref', which it doesn't. From [1]: out parameters are set to the default initializer for the type of it. Also, this newsgroup is for automated messages from D's Bugzilla. You might want to ask this kind of questions in digitalmars.D.learn in the future. [1]: http://digitalmars.com/d/2.0/function.html#parameters -- Simen
Re: Bug Of pow in std.math
sins666 d-bugm...@puremagic.com wrote: import std.math; import std.stdio; void main() { writeln(pow(5, 2)); // 25 writeln(pow(5, 0)); // 1 writeln(pow(5, -3)); // object.Error: Integer Divide by Zero } And dmd version is 2.047. Was I mistake in my source.or bug? The mistake is in your code. std.math.pow has a version that takes only integers, and returns only integers. That is the version you are using. If instead you try: writeln(pow(5.0, -3.0)); You should see improvement. -- Simen
Re: Bug Of pow in std.math
sins666 d-bugm...@puremagic.com wrote: I found a Bug.The bug lives in function of pow in std.math. When wake up the bug that, we select value of minus to second argument of pow. And happen the object.Error: Integer Divide by Zero error. I think that is a Bug. Is it? I would recommend discussing such in digitalmars.D.learn. Now, I'm not able to recreate this. Am I right to understand it to be: std.math.pow( 5, -3 ); ? If not, would you please post code that triggers the bug? -- Simen
Re: D2 phobos BigInt bug
Don wrote: I don't think that will ever get fixed (unless you make a patch yourself). Phobos BigInt was created by Janice, and she seems to have completely disappeared. I'm working on Tango BigInt, which is completely independent, and will replace Phobos BigInt eventually. ( == as soon as we get a common namespace to put it into). I don't think anyone is interested in debugging Phobos BigInt. Should still be bugzilla'd, so people know it's broken atm, and get notified when it's working. -- Simen