[Issue 14059] New: Formatted write with wrong formatting string

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 27 04:27:24 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14059

          Issue ID: 14059
           Summary: Formatted write with wrong formatting string
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

void main() {
    import std.stdio;
    auto a = ["red", "blue"];
    writefln("%-(%s%", a);
}


If compiled normally gives (dmd 2.067alpha):

core.exception.RangeError at std\format.d(878): Range violation


Compiling with -release -boundscheck=off gives:

object.Exception at ...\dmd2\src\phobos\std\format.d(871): Incorrect format
specifier: %(%s%

I think it should give the second error message in both cases.

--


More information about the Digitalmars-d-bugs mailing list