Bug 342 – Please add "import std.stdio;" to object.d and remove extern(C) printf;

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2006-09-10T14:33:00Z
Last change time
2014-02-15T13:28:47Z
Keywords
patch
Assigned to
bugzilla
Creator
aarti

Comments

Comment #0 by aarti — 2006-09-10T14:33:00Z
printf completely does not fit as a D standard console output command. It only polutes global namespaces. IMHO it's presents is a big trap for novice users - it's easy to pass to function not null terminated char[]. In contradict writefln and writef is much nicer to use and should be default.
Comment #1 by smjg — 2006-09-10T18:58:48Z
Patches have been posted here: http://tinyurl.com/e9efj Somewhere in the same thread is a follow-on from this patch to fix bug 64 as well.
Comment #2 by smjg — 2006-12-16T20:53:21Z
For a moment I'd forgotten that this had already been filed here! Should object.d import the whole of stdio, or only writef and writefln? I was about to propose using public import std.stdio : writef, writefln; There may be people who still want to use printf regardless, but they can import it. Just put it back in std.c.stdio where it belongs. There's no reason that D should make the printf antique more readily accessible than all other library features. See also issue 689.
Comment #3 by clugdbug — 2009-05-26T04:27:52Z
printf() is fixed in D2, and will never be fixed in D1. Time to close.