[Issue 11423] Error: new can only create structs, dynamic arrays or class objects, not _error_'s
http://d.puremagic.com/issues/show_bug.cgi?id=11423 Kenji Hara changed: What|Removed |Added Keywords||diagnostic, pull --- Comment #1 from Kenji Hara 2013-11-03 00:08:59 PDT --- https://github.com/D-Programming-Language/dmd/pull/2710 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11424] Regression (2.064 git-head) typedef on structs isn't caught
http://d.puremagic.com/issues/show_bug.cgi?id=11424 Kenji Hara changed: What|Removed |Added Keywords||accepts-invalid, pull --- Comment #2 from Kenji Hara 2013-11-03 00:27:46 PDT --- The regression has been caused by fixing bug 11145. https://github.com/D-Programming-Language/dmd/pull/2711 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11423] Error: new can only create structs, dynamic arrays or class objects, not _error_'s
http://d.puremagic.com/issues/show_bug.cgi?id=11423 --- Comment #2 from github-bugzi...@puremagic.com 2013-11-03 00:48:31 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/8121cf8ed5cb41d6905a0ac3169c3f397e58dab5 fix Issue 11423 - Error: new can only create structs, dynamic arrays or class objects, not _error_'s https://github.com/D-Programming-Language/dmd/commit/dc6628429ed8af254f80c86845d9237ebf5daf00 Merge pull request #2710 from 9rnsr/fix11423 Issue 11423 - Error: new can only create structs, dynamic arrays or class objects, not _error_'s -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11423] Error: new can only create structs, dynamic arrays or class objects, not _error_'s
http://d.puremagic.com/issues/show_bug.cgi?id=11423 yebblies changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11426] New: Reinterpret element-wise array initializing should be rejeted
http://d.puremagic.com/issues/show_bug.cgi?id=11426 Summary: Reinterpret element-wise array initializing should be rejeted Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: k.hara...@gmail.com --- Comment #0 from Kenji Hara 2013-11-03 01:08:08 PST --- This is a regression issue from 2.061. void main() { uint[] udarr; uint[1] usarr; int[1] arr1; arr1 = udarr; // Error, OK int[1] arr2; arr2 = usarr; // Error, OK int[1] arr3 = udarr;// accepted, BAD! int[1] arr4 = usarr;// accepted, BAD! } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11206] static array can be implicitly built from items, when nested in aggregate
http://d.puremagic.com/issues/show_bug.cgi?id=11206 --- Comment #16 from Kenji Hara 2013-11-03 01:18:36 PST --- (In reply to comment #15) > (In reply to comment #10) > > uint[] udarr; > > uint[1] usarr; > > > > int[1] arr1 = udarr; //OK > > int[1] arr2 = usarr; //OK > > Mmm...I think this is a bug. Because following code is also accepted in > compilation, and will cause runtime exception! > > void main() > { > int[4] sa; > ulong[4] sa2 = sa; > } I opened bug 11426. It is a regression issue from 2.061. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11426] Reinterpret element-wise array initializing should be rejeted
http://d.puremagic.com/issues/show_bug.cgi?id=11426 Kenji Hara changed: What|Removed |Added Keywords||pull --- Comment #1 from Kenji Hara 2013-11-03 01:15:46 PST --- https://github.com/D-Programming-Language/dmd/pull/2712 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11427] New: anonymous unions break structs in @safe code
http://d.puremagic.com/issues/show_bug.cgi?id=11427 Summary: anonymous unions break structs in @safe code Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: r.sagita...@gmx.de --- Comment #0 from Rainer Schuetze 2013-11-03 01:52:10 PST --- Compile this code /// struct S { union { ubyte a; int x; } void[] arr; } int foo() @safe { S s1 = S(); S s2; return 0; } with "dmd -c test.d" fails with test.d(14): Error: variable test.foo.s2 unions containing pointers are not allowed in @safe functions Please note that the first variable s1 is ok! This is also triggered in std.format with this code: import std.format; import std.array; void foo() { FormatSpec!char spec = FormatSpec!char(); auto s = appender!string; formattedWrite(s, "%s", "hello"); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11377] if add -inline option. dmd source file in assertion failed.
http://d.puremagic.com/issues/show_bug.cgi?id=11377 --- Comment #2 from Kenji Hara 2013-11-03 01:19:29 PST --- On Windows -m32, the issue reproduces with 2.063, but it does not occur with 2.064beta4. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11427] anonymous unions break structs in @safe code
http://d.puremagic.com/issues/show_bug.cgi?id=11427 --- Comment #1 from Rainer Schuetze 2013-11-03 01:32:10 PST --- Hmmm, something wrong with bugzilla? My comment replaced the description, and the initial description is now moved into the first comment. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10750] Strict aliasing semantics
http://d.puremagic.com/issues/show_bug.cgi?id=10750 --- Comment #3 from Johannes Pfau 2013-11-03 02:13:39 PST --- @bearophile: To further expand on this: http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Optimize-Options.html says: "type-punning is allowed, provided the memory is accessed through the union type. [...] access by taking the address, casting the resulting pointer and dereferencing the result has undefined behavior, even if the cast uses a union type, e.g.: " @David What would a safe cast with strict pointer aliasing look like? First some background information on how aliasing is implemented in gcc (alias.c): Every type is assigned an alias set. The alias set is only a unique id + a flattened list of the uids of all 'member types'. For example, this struct: -- struct B { char member; } struct A { int member1, float member2; B member3; } -- will generate this alias set: uid=1, children={2(int),3(float),4(char)} Then for code like this: -- A instance; instance.member1 = 0; A copy = a; -- The compiler now inspects the line instance.member1 = 0; and assigns alias set 2(int) to it. Line 3 has alias set 1(B). When gcc now schedules instructions it checks if set 2 conflicts with set 1 by checking: (set1 == set2 || set1 in set2.children || set2 in set1.children). If they don't conflict gcc reorders instructions. This explains the problems with type punning: -- int a = 3;//alias set 0(int), children = {} int b = a;//alias set 0(int), children = {} *(cast(float*)&a) = 3.0f; //alias set 1(float), children = {} -- as you can see these types don't conflict and gcc may reorder line 2 and 3. Access through unions now solves this problem as the alias set for a union would include both {float, int} as children. But as for as I understand these strict alising rules make it impossible to safely cast from one pointer type to another. Only _access_ through unions will work. As an example: -- T* safeCast(T, U)(U* input) { union wrap { U inp; T outp; } return &(cast(wrap*)input).outp; } void withFloat(float* f) { *f = 0.1f; } int b; void withInt(int* i) { b = *i; } void main() { int x = 0; auto asFloat = (safeCast!float(&x)); withFloat(asFloat) withInt(&i); } -- now with optimizations (inlining) union wrap { int inp; float outp; } int b; void main() { int x = 0;//alias set: int auto asFloat = (&(cast(wrap*)x).outp) //alias set: wrap (but noop) *asFloat = 0.1f; //alias set: float b = x;//alias set: int } I know from unfortunate experienc, that gcc may even completely discard the "auto asFloat" line. But even if it didn't, "*asFloat = 0.1f;" and "b = x;" can be reordered according to strict aliasing rules. If "auto asFloat" is discarded, even "int x = 0;" and "*asFloat = 0.1f;" may be reordered. So to summarize this: I don't know how you could make a safe cast from T* to U* assuming strict aliasing rules. Unions are only safe if all access goes through unions, but that is not possible when dealing with 3rd party functions. (Assume you can't change withFloat, withInt). We had problems with this in GDC right now on ARM (std.algorithm.find uses cast(ubyte[])string which internally translates to invalid pointer aliasing) and as a result we'll now have to disable strict aliasing in the GCC backend. I think type based aliasing, even if it may provide some optimization benefits, is in general a horrible idea. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10750] Strict aliasing semantics
http://d.puremagic.com/issues/show_bug.cgi?id=10750 Iain Buclaw changed: What|Removed |Added CC||ibuc...@ubuntu.com --- Comment #4 from Iain Buclaw 2013-11-03 03:17:17 PST --- (In reply to comment #3) > We had problems with this in GDC right now on ARM (std.algorithm.find uses > cast(ubyte[])string which internally translates to invalid pointer aliasing) > and as a result we'll now have to disable strict aliasing in the GCC backend. > Which is a shame, because dynamic arrays are perhaps the one type in D that should instead benefit from strict aliasing rules... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11428] New: A simple std.array.array call at compile-time refused
http://d.puremagic.com/issues/show_bug.cgi?id=11428 Summary: A simple std.array.array call at compile-time refused Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2013-11-03 03:31:19 PST --- I think this should work, I don't know if this is a regression: import std.array: array; const r1 = [""].array; // Error void main() { const r2 = [""].array; // OK } dmd 2.064beta4 gives: ...\dmd2\src\phobos\std\array.d(44): Error: returning a pointer to a local stack variable ...\dmd2\src\phobos\std\array.d(48):called from here: trustedGetAddr(result[i]) ...\dmd2\src\phobos\std\array.d(48):called from here: emplace(trustedGetAddr(result[i]), e) test.d(2):called from here: array([""]) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10750] Strict aliasing semantics
http://d.puremagic.com/issues/show_bug.cgi?id=10750 --- Comment #5 from Iain Buclaw 2013-11-03 03:43:06 PST --- (In reply to comment #4) > (In reply to comment #3) > > We had problems with this in GDC right now on ARM (std.algorithm.find uses > > cast(ubyte[])string which internally translates to invalid pointer aliasing) > > and as a result we'll now have to disable strict aliasing in the GCC > > backend. > > > > Which is a shame, because dynamic arrays are perhaps the one type in D that > should instead benefit from strict aliasing rules... Alternatively, we can just define better aliasing rules that better suit D. ie: - Permit type-punning when accessing through a union. - Determine aliasing rules of dynamic arrays from the elem type, instead of treating it as aliasing the overall structure. This might actually be the better solution for us - shall I send you a patch? :o) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11428] A simple std.array.array call at compile-time refused
http://d.puremagic.com/issues/show_bug.cgi?id=11428 monarchdo...@gmail.com changed: What|Removed |Added CC||monarchdo...@gmail.com --- Comment #1 from monarchdo...@gmail.com 2013-11-03 06:30:19 PST --- It's not a regression, because array was not CTFE-able prior to 2.064. I say CTFE, because you are declaring a global static. This also recreates the issue: // import std.array: array; void main() { enum r1 = [""].array; // KO static const r2 = [""].array; // KO } // The "issue" seems to only happen if the element type is a string. I can't reproduce with other types. Further more, it only happens if the string is a literal. EG: // void main() { static const string r = ""; static const r1 = r.array; // OK static const r2 = [1].array; // OK static const r2 = [""].array; // ERROR } // Here is a reduced case. // T[] arr(T)(T[] input) { static T* getAddr(ref T t) { return &t; //Error: returning a pointer to a local stack variable } getAddr(input[0]); return input; } void main() { static const string r = ""; static const r1 = r.arr; // OK static const r2 = [1].arr; // OK static const r3 = [""].arr; // ERROR } // I can't really make any sense of this on my end. Maybe Don has an idea? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11429] New: Deprecate walkLength?
http://d.puremagic.com/issues/show_bug.cgi?id=11429 Summary: Deprecate walkLength? Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2013-11-03 06:39:25 PST --- This is an alternative to issue 8467. If issue 8467 is refused, then I suggest to just deprecate walkLength, and leave only count(), because it can replace walkLength (if count lacks the ".length" shortcut optimization, it should be added): import std.algorithm: count, map; void main() { assert([0, 0, 1].map!(x => x).count == 3); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11392] dirEntries segfaults (fails in 2.064 beta 4, works in 2.063.2)
http://d.puremagic.com/issues/show_bug.cgi?id=11392 --- Comment #11 from github-bugzi...@puremagic.com 2013-11-03 06:37:12 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/fe9a3537ea2d208f3d5e37f6a2ea6e50f00aadd2 fix Issue 11392 - dirEntries segfaults https://github.com/D-Programming-Language/phobos/commit/2a0d3d63954ed31d585708a41394e46115f9007d Merge pull request #1680 from WalterBright/fix11392 fix Issue 11392 - dirEntries segfaults -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11404] ICE on using TypeTuple for AA values
http://d.puremagic.com/issues/show_bug.cgi?id=11404 --- Comment #3 from github-bugzi...@puremagic.com 2013-11-03 07:15:29 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a22e95e0e8f666001f8a67a61f231f94fca71217 fix Issue 11404 - ICE on using TypeTuple for AA values https://github.com/D-Programming-Language/dmd/commit/4047a61792e5226bea796ce36db26af0aa919494 Merge pull request #2707 from 9rnsr/fix11404 Issue 11404 - ICE on using TypeTuple for AA values -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11404] ICE on using TypeTuple for AA values
http://d.puremagic.com/issues/show_bug.cgi?id=11404 yebblies changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11424] Regression (2.064 git-head) typedef on structs isn't caught
http://d.puremagic.com/issues/show_bug.cgi?id=11424 --- Comment #3 from github-bugzi...@puremagic.com 2013-11-03 07:19:46 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2a2fa477d09d5c7416ad98cb5615235d4c519efc fix Issue 11424 - typedef on structs isn't caught It should be caught even if the typedef keyword usage is meaningless. https://github.com/D-Programming-Language/dmd/commit/05686c7184571fc931f8f79d859da219800d3e41 Merge pull request #2711 from 9rnsr/fix11424 [REG2.064a] Issue 11424 - typedef on structs isn't caught -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10015] Segfault on forward referencing a variable of templated struct
http://d.puremagic.com/issues/show_bug.cgi?id=10015 --- Comment #2 from github-bugzi...@puremagic.com 2013-11-03 07:28:36 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5bb812cf4f3abad8345739729df929efccc4989c fix Issue 10015 - Segfault on forward referencing a variable of templated struct https://github.com/D-Programming-Language/dmd/commit/d40a8096b158fb957be982a8c6f6d4cd868086ec Merge pull request #2708 from 9rnsr/fix10015 Issue 10015 - Segfault on forward referencing a variable of templated struct -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11424] Regression (2.064 git-head) typedef on structs isn't caught
http://d.puremagic.com/issues/show_bug.cgi?id=11424 Andrej Mitrovic changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10015] Segfault on forward referencing a variable of templated struct
http://d.puremagic.com/issues/show_bug.cgi?id=10015 yebblies changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11226] Problems with typeof(null) and const
http://d.puremagic.com/issues/show_bug.cgi?id=11226 yebblies changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11226] Problems with typeof(null) and const
http://d.puremagic.com/issues/show_bug.cgi?id=11226 --- Comment #3 from github-bugzi...@puremagic.com 2013-11-03 07:32:05 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/068f4e55d611054a8c6f80e8479884ce1d1b1c4c fix Issue 11226 - Problems with typeof(null) and const https://github.com/D-Programming-Language/dmd/commit/fec22e29d835977551fe808bfc63d1f73e6ae832 Merge pull request #2703 from 9rnsr/fix11226 Issue 11226 - Problems with typeof(null) and const -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11430] New: A simpler overload for std.file.slurp
http://d.puremagic.com/issues/show_bug.cgi?id=11430 Summary: A simpler overload for std.file.slurp Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2013-11-03 07:33:34 PST --- I think it could be handy to add another overload of the std.file.slurp template function. Currently (dmd 2.064) this is its usage syntax (using UFCS for the file name), that essentially states the types two times: const arr1 = "data.txt".slurp!(int, int)("%d, %d"); If the user wants to state them only once (more DRY) then slurp could also accept: const arr2 = "data.txt".slurp!"%d, %d"; This is not a replacement for the precedent syntax because the formatting syntax is less precise ("%d %f" can only take an int and a double, so with this syntax you can't specify a long and a real), but in many common cases I think it's enough and it's simpler. (In theory the API of slurp could even change, returning a lazy range, useful for larger files.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11424] Regression (2.064 git-head) typedef on structs isn't caught
http://d.puremagic.com/issues/show_bug.cgi?id=11424 --- Comment #4 from github-bugzi...@puremagic.com 2013-11-03 07:50:54 PST --- Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7762f03709b8ceb0950f02d47cf4e703bdbabc6b Merge pull request #2711 from 9rnsr/fix11424 [REG2.064a] Issue 11424 - typedef on structs isn't caught -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10259] ICE on invalid compile-time class instantiation
http://d.puremagic.com/issues/show_bug.cgi?id=10259 yebblies changed: What|Removed |Added CC||yebbl...@gmail.com --- Comment #2 from yebblies 2013-11-04 03:18:52 EST --- This bug doesn't seem to ice any more, on win32. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11291] Disallow mutation of a const variable
http://d.puremagic.com/issues/show_bug.cgi?id=11291 --- Comment #3 from github-bugzi...@puremagic.com 2013-11-03 08:26:50 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d826696f214166a07371c4401e3a1d6e27bd5082 fix Issue 11291 - Disallow mutation of a const variable https://github.com/D-Programming-Language/dmd/commit/1c0f7a2c7cc4943076d5bd5d30c31dc19fd7ef0b Merge pull request #2678 from 9rnsr/fix11291 Issue 11291 - Disallow mutation of a const variable -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5747] cannot cast away shared if opCast defined
http://d.puremagic.com/issues/show_bug.cgi?id=5747 monarchdo...@gmail.com changed: What|Removed |Added CC||monarchdo...@gmail.com --- Comment #4 from monarchdo...@gmail.com 2013-11-03 08:31:45 PST --- Just hit this. IMO, this is a bug: The presence of an opCast should not prevent "qualification-cast", which don't actually change the type. In particular, the problem is that *even* trying to hand write it, it's not possible: // import std.traits; struct S { int* p; //prevent implicit cast T opCast(T:bool)() pure const { return false; } T opCast(T)() const if (is(Unqual!T == S)) { return this; //This fails return cast(T) this; //This overflows } } void main() { immutable(S) s; auto b = cast(S)(s); //How to do this? } // IMO, a cast to the *same* type (but different quals) should always be defined by the compiler, even if another opCast is defined, unless the use explicitly overrides *that* opCast. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11291] Disallow mutation of a const variable
http://d.puremagic.com/issues/show_bug.cgi?id=11291 yebblies changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11431] New: std.file.slurp with Windows newlines
http://d.puremagic.com/issues/show_bug.cgi?id=11431 Summary: std.file.slurp with Windows newlines Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2013-11-03 08:35:57 PST --- If I create a simple "data.txt" file containing this, with Windows newlines: 10 20 30 And I try to read it with slurp: import std.file: slurp; void main() { slurp!(int)("data.txt", "%d"); } I get a stack trace: object.Exception@...\dmd2\src\phobos\std\file.d(2992): Trailing characters at the end of line: ` ' - 0x00413C36 in pure @safe void std.exception.bailOut(immutable(char)[], uint, const(char[])) ... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11432] New: formattedRead and slurp %s format code miss tab as whitespace
http://d.puremagic.com/issues/show_bug.cgi?id=11432 Summary: formattedRead and slurp %s format code miss tab as whitespace Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2013-11-03 09:12:46 PST --- This is a C program, note the string s that contains three fields, each separated by a single tab: #include #include int main() { char* s = "red\t10\t20"; char t[20]; int a, b; sscanf(s, "%s %d %d", &t, &a, &b); printf(">%s<>%d<>%d<\n", t, a, b); return 0; } It prints the output I expect: >red<>10<>20< The syntax of scanf says regarding the %s code: http://www.mkssoftware.com/docs/man3/scanf.3.asp s A character string is expected; the corresponding argument should be a character pointer pointing to an array of characters large enough to accept the string and a terminating \0, which is added automatically. A white-space character terminates the input field. The conversion specifier hS is equivalent. I think this is a similar D program: import std.format, std.stdio; void main() { string s = "red\t10\t20"; string t; int a, b; formattedRead(s, "%s %d %d", &t, &a, &b); writef(">%s<>%d<>%d<\n", t, a, b); } But it prints: >red10 20<>0<>0< As you see the tab is considered part of the first string field. This causes me troubles when I use slurp as shown below. If I have this "data.txt" text file with Unix-style newlines, and where the string is separated by the integer with just 1 tab character: red 10 blue20 (So the whole file is: "red\t10\nblue\t20"). If I run this code: import std.file: slurp; void main() { slurp!(string, int)("data.txt", "%s %d"); } I get a stacktrace (dmd 2.064beta4): std.conv.ConvException@...\dmd2\src\phobos\std\conv.d(2009): Unexpected end of input when converting from type char[] to type int 0x0040E269 in pure @safe int std.conv.parse!(int, char[]).parse(ref char[]) at C:\dmd2\src\phobos\std\conv.d(2010) ... To avoid the stack trace I have to put a tab between the two formattings: import std.file: slurp; void main() { slurp!(string, int)("data.txt", "%s\t%d"); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11426] Reinterpret element-wise array initializing should be rejeted
http://d.puremagic.com/issues/show_bug.cgi?id=11426 --- Comment #2 from github-bugzi...@puremagic.com 2013-11-03 10:53:47 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0a36934cc7fef35092887747f78ed1d3f599b179 fix Issue 11426 - Reinterpret element-wise array initializing should be rejected https://github.com/D-Programming-Language/dmd/commit/21a6e3eb242c9823b46a78e5e18a23f7b6064ab1 Merge pull request #2712 from 9rnsr/fix11426 [REG2.061] Issue 11426 - Reinterpret element-wise array initializing should be rejeted -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11426] Reinterpret element-wise array initializing should be rejeted
http://d.puremagic.com/issues/show_bug.cgi?id=11426 --- Comment #3 from github-bugzi...@puremagic.com 2013-11-03 10:59:25 PST --- Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d6f1a0ea1e13b435dc40ef34fa70c687bf73c7e0 Merge pull request #2712 from 9rnsr/fix11426 [REG2.061] Issue 11426 - Reinterpret element-wise array initializing should be rejeted -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11426] Reinterpret element-wise array initializing should be rejeted
http://d.puremagic.com/issues/show_bug.cgi?id=11426 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11392] dirEntries segfaults (fails in 2.064 beta 4, works in 2.063.2)
http://d.puremagic.com/issues/show_bug.cgi?id=11392 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #13 from Walter Bright 2013-11-03 11:18:40 PST --- This was fixed by: https://github.com/D-Programming-Language/dmd/pull/2701 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11392] dirEntries segfaults (fails in 2.064 beta 4, works in 2.063.2)
http://d.puremagic.com/issues/show_bug.cgi?id=11392 --- Comment #12 from github-bugzi...@puremagic.com 2013-11-03 11:16:39 PST --- Commit pushed to 2.064 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/3fe0703932d7b2486ec838045dd76322f1b54026 Merge pull request #1680 from WalterBright/fix11392 fix Issue 11392 - dirEntries segfaults -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11393] GC realloc and free don't ignore interior pointers
http://d.puremagic.com/issues/show_bug.cgi?id=11393 --- Comment #2 from safety0ff.bugz 2013-11-03 11:25:28 PST --- Discussion thread: http://forum.dlang.org/thread/qmiayckycycetnumu...@forum.dlang.org -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11139] malloc/emplace resulting in memory corruption
http://d.puremagic.com/issues/show_bug.cgi?id=11139 --- Comment #9 from safety0ff.bugz 2013-11-03 11:36:08 PST --- Ignore the above comment, if I add GC.addRange(tmp, size) after line 24 it stops segfaulting. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11433] Forum hyperlink parser doesn't recognize + signs as part of the link
http://d.puremagic.com/issues/show_bug.cgi?id=11433 --- Comment #1 from Joseph Rushton Wakeling 2013-11-03 13:24:42 PST --- Hah. I see that bugzilla also gets it wrong. :-) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11433] New: Forum hyperlink parser doesn't recognize + signs as part of the link
http://d.puremagic.com/issues/show_bug.cgi?id=11433 Summary: Forum hyperlink parser doesn't recognize + signs as part of the link Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: websites AssignedTo: nob...@puremagic.com ReportedBy: joseph.wakel...@webdrake.net --- Comment #0 from Joseph Rushton Wakeling 2013-11-03 13:24:24 PST --- In the following forum post Ali �ehreli posted a link that ends with ++: http://forum.dlang.org/post/l53v9p$2uru$1...@digitalmars.com Namely: http://en.wikipedia.org/wiki/Operators_in_C_and_C++ The forum does not recognize the final ++ as part of the link, and so the resulting hyperlink does not point to the right place. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11188] std.math.abs fails for shared, const or immutable BigInt types
http://d.puremagic.com/issues/show_bug.cgi?id=11188 --- Comment #8 from Simen Kjaeraas 2013-11-03 13:25:17 PST --- Adding this overload to std.math is a workaround for the problems with shared: Num abs(Num)(shared Num x) @safe pure nothrow if (is(typeof(abs(Num.init))) && is(typeof({Num n = x;}))) { Num tmp = x; return abs(tmp); } However, given that shared is currently rather ill-specified, and possibly will change dramatically relatively soon (let's hope so), and that this is a workaround for a single function only, I feel it's better to leave the workaround out for the time being, and wait for a real solution. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11433] Forum hyperlink parser doesn't recognize + signs as part of the link
http://d.puremagic.com/issues/show_bug.cgi?id=11433 changed: What|Removed |Added CC||mailnew4s...@gmail.com --- Comment #2 from 2013-11-03 13:38:28 PST --- Wikipedia gets it right, though, even with the wrong link ;) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11401] ElementType returns constructor instead of type
http://d.puremagic.com/issues/show_bug.cgi?id=11401 Andrei Alexandrescu changed: What|Removed |Added CC||and...@erdani.com --- Comment #1 from Andrei Alexandrescu 2013-11-03 13:44:30 PST --- Turns out it's a compiler bug, not a library one. I reduced the code to: struct RowRange { BasicNode front() { return BasicNode.init; } } struct BasicNode { ushort id; } void main() { alias E1 = typeof(RowRange.init.front()); static assert(is(typeof(E1.id)), E1.stringof~" is expected to have a 'id' member"); alias E2 = typeof(RowRange.init.front); static assert(is(typeof(E2.id)), E2.stringof~" is expected to have a 'id' member"); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11433] Forum hyperlink parser doesn't recognize + signs as part of the link
http://d.puremagic.com/issues/show_bug.cgi?id=11433 --- Comment #3 from Joseph Rushton Wakeling 2013-11-03 13:48:18 PST --- (In reply to comment #2) > Wikipedia gets it right, though, even with the wrong link ;) Funny ... :-) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 472] zero sized _init_* symtab-objects
http://d.puremagic.com/issues/show_bug.cgi?id=472 Martin Krejcirik changed: What|Removed |Added Status|ASSIGNED|RESOLVED CC||m...@krej.cz Resolution||FIXED --- Comment #1 from Martin Krejcirik 2013-11-03 23:45:14 CET --- Seems fixed in DMD 1.076 and D2. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 472] zero sized _init_* symtab-objects
http://d.puremagic.com/issues/show_bug.cgi?id=472 --- Comment #2 from Andrei Alexandrescu 2013-11-03 14:53:26 PST --- Thanks for following up on this old bug! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 602] Compiler allows a goto statement to skip an initalization
http://d.puremagic.com/issues/show_bug.cgi?id=602 --- Comment #7 from Stewart Gordon 2013-11-03 17:17:25 PST --- It seems to me quite simple: If there is any variable that is in scope at the point of the label but not at the point of the goto statement, then we have a problem. Is there any case that this doesn't cover? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11401] ElementType returns constructor instead of type
http://d.puremagic.com/issues/show_bug.cgi?id=11401 --- Comment #2 from Kenji Hara 2013-11-03 18:33:49 PST --- This is git-head only issue. Introduced by: https://github.com/D-Programming-Language/phobos/pull/1658 (In reply to comment #1) > alias E1 = typeof(RowRange.init.front()); > static assert(is(typeof(E1.id)), > E1.stringof~" is expected to have a 'id' member"); > alias E2 = typeof(RowRange.init.front); > static assert(is(typeof(E2.id)), > E2.stringof~" is expected to have a 'id' member"); Currently typeof(non_property_func) returns the function type, not its return type. It is intended behavior, and this is not a compiler issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11401] ElementType returns constructor instead of type
http://d.puremagic.com/issues/show_bug.cgi?id=11401 Kenji Hara changed: What|Removed |Added Keywords||pull, rejects-valid --- Comment #3 from Kenji Hara 2013-11-03 19:15:28 PST --- https://github.com/D-Programming-Language/phobos/pull/1681 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9665] Structure constant members can not be initialized if have opAssign
http://d.puremagic.com/issues/show_bug.cgi?id=9665 --- Comment #29 from github-bugzi...@puremagic.com 2013-11-03 20:49:18 PST --- Commit pushed to 2.064 at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/101d3a7a229b45bd97bc922f7c4df465f72d2432 Merge pull request #404 from 9rnsr/fix9665 Issue 9665 - Structure constant members can not be initialized if have opAssign -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 9665] Structure constant members can not be initialized if have opAssign
http://d.puremagic.com/issues/show_bug.cgi?id=9665 --- Comment #28 from github-bugzi...@puremagic.com 2013-11-03 20:47:08 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/76bf0a581313aa6f2702f23a577f28d32a5d385f fix Issue 9665 - Structure constant members can not be initialized if have opAssign Describe about field initialization behavior. https://github.com/D-Programming-Language/dlang.org/commit/0af070ef719ef65ddd325dfb5d68b5fd987ce6aa Merge pull request #404 from 9rnsr/fix9665 Issue 9665 - Structure constant members can not be initialized if have opAssign -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 11434] New: std.file.copy doesn't preserve file attributes (eg: executable mode etc)
http://d.puremagic.com/issues/show_bug.cgi?id=11434 Summary: std.file.copy doesn't preserve file attributes (eg: executable mode etc) Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: thelastmamm...@gmail.com --- Comment #0 from thelastmamm...@gmail.com 2013-11-03 21:25:10 PST --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---