Bug 14059 – Formatted write with wrong formatting string

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-27T12:27:00Z
Last change time
2015-02-18T03:42:01Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2015-01-27T12:27:24Z
void main() { import std.stdio; auto a = ["red", "blue"]; writefln("%-(%s%", a); } If compiled normally gives (dmd 2.067alpha): core.exception.RangeError@std\format.d(878): Range violation Compiling with -release -boundscheck=off gives: object.Exception@...\dmd2\src\phobos\std\format.d(871): Incorrect format specifier: %(%s% I think it should give the second error message in both cases.
Comment #1 by github-bugzilla — 2015-02-06T14:06:42Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/806361692978e538ed782287d796e58b2ed5b8df Issue 14059 - Formatted write with wrong formatting string https://github.com/D-Programming-Language/phobos/commit/3299c63e7500e6eeb9f5f3c9f8f3ec501fde6064 Merge pull request #2958 from sinkuu/fix_14059_format Issue 14059 - Formatted write with wrong formatting string
Comment #2 by github-bugzilla — 2015-02-07T20:32:48Z
Comment #3 by github-bugzilla — 2015-02-18T03:42:01Z