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