http://d.puremagic.com/issues/show_bug.cgi?id=4927
Summary: writefln silently ignores arguments not present in the
format string
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2010-09-23 15:33:40 PDT ---
With dmd 2.049 this program:
import std.stdio: writefln;
void main() {
writefln("%d", 1, 2);
}
Prints:
1
But in this case I expect a compile-time error (or equivalent run-time error if
the compiler is lazy and doesn't perform such very basic tests at
compile-time), because the format string doesn't contain the same things as the
given arguments.
In this case printing 12 is not good, because when a writefln is used, it's
better to avoid possible bugs to enforce that arguments and format string match
exactly.
See also bug 4458
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------