Bug 17281 – std.format.format should not allow nonsensical format specifiers

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-03-28T16:44:33Z
Last change time
2024-12-01T16:29:58Z
Assigned to
Lucia Cojocaru
Creator
hsteoh
See also
https://issues.dlang.org/show_bug.cgi?id=3248
Moved to GitHub: phobos#9713 →

Comments

Comment #0 by hsteoh — 2017-03-28T16:44:33Z
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 strings.
Comment #1 by robert.schadek — 2024-12-01T16:29:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9713 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB