[Issue 12162] New: writeln(args) and writefln("%s", args) have different semantics with variadic args

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 14 12:38:48 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12162

           Summary: writeln(args) and writefln("%s", args) have different
                    semantics with variadic args
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-02-14 12:38:46 PST ---
-----
import std.stdio;

void test(T...)(T args)
{
    writefln("%s", args);
    writeln(args);
}

void main()
{
    test(1, 2, 3, 4);
}
-----

$ dmd test.d
> 1
> 1234

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


More information about the Digitalmars-d-bugs mailing list