Thread overview
[Issue 4822] New: Problem with std.stdio.File.writef("%c"
Apr 21, 2012
SomeDude
Apr 23, 2012
Kenji Hara
September 05, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4822

           Summary: Problem with std.stdio.File.writef("%c"
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2010-09-05 11:19:51 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4822


Lars T. Kyllingstad <bugzilla@kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@kyllingen.net


--- Comment #1 from Lars T. Kyllingstad <bugzilla@kyllingen.net> 2011-02-03 00:50:11 PST ---
According to the std.format documentation, "%c" is not a valid format specifier.  The error message could be improved, though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4822


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com


--- Comment #2 from SomeDude <lovelydear@mailmetrash.com> 2012-04-21 15:37:32 PDT ---
The program runs fine on 2.059, and the text file is created with 'x' inside.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 23, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4822


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-22 17:48:15 PDT ---
"%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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------