Bug 4822 – Problem with std.stdio.File.writef("%c"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-05T11:19:00Z
Last change time
2012-04-22T17:48:15Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-09-05T11:19:51Z
I think this is a correct D2 program: import std.stdio: File; void main() { auto f = File("test.txt", "w"); f.writef("%c", 'x'); } But DMD dmd 2.048 gives at runtime: std.format.FormatError: std.format integral
Comment #1 by bugzilla — 2011-02-03T00:50:11Z
According to the std.format documentation, "%c" is not a valid format specifier. The error message could be improved, though.
Comment #2 by lovelydear — 2012-04-21T15:37:32Z
The program runs fine on 2.059, and the text file is created with 'x' inside.
Comment #3 by k.hara.pg — 2012-04-22T17:48:15Z
"%c" format specifier has been supported from 2.058: http://dlang.org/phobos/std_format It was fixed by the pull request: https://github.com/D-Programming-Language/phobos/pull/298