www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17281] New: std.format.format should not allow nonsensical


          Issue ID: 17281
           Summary: std.format.format should not allow nonsensical format
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

Currently, the documentation for std.format.format states that specifiers
consist of '%' followed by optional Position, optional Flags, optional Width,
optional Precision, and finally the format character.

However, the actual implementation is far more lax, and allows nonsensical
specifiers such as the following:

import std.stdio;
void main() {
        writefln("%3+-.3#-+-.3---+++###s", "WAT");

The implementation ought to be cleaned up to reject such nonsensical format

Mar 28 2017