Bug 6663 – std.stdio conflicts with core.stdc.stdio

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2011-09-13T12:21:08Z
Last change time
2020-03-21T03:56:33Z
Assigned to
No Owner
Creator
Jerry Quinn

Comments

Comment #0 by jlquinn — 2011-09-13T12:21:08Z
DMD 2.055 on Ubuntu x86_64. Compile the following junk.d file: import std.stdio; import std.cstream; void main(string[] argv) { derr.writef("CONTINUE ... \n"); stdout.write("hi\n"); } ~/dmd2/linux/bin64/dmd junk.d junk.d(5): Error: std.stdio.stdout at /home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/stdio.d(2192) conflicts with core.stdc.stdio.stdout at /home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdio.di(264)
Comment #1 by dlang-bugzilla — 2011-09-13T12:35:47Z
Why do you think this is a bug? Solutions to your problem include selective imports (import std.cstream : derr), or using disambiguation aliases (alias std.stdio.stdout stdout).
Comment #2 by jlquinn — 2011-09-13T13:14:05Z
I think it's an error because I should be able to use facilities from the standard library without such conflict. Note that I'm not asking for guarantees about how the streams are synchronized, but it ought to compile and basically run. Sorry, I don't accept that a D user should have to distinguish between 2 stdout objects. A lot of effort is going into improving Phobos to make it civilized. This isn't. I do accept that std.stream is going to undergo a rework and that this issue may just disappear as part of that, though :-)
Comment #3 by dlang-bugzilla — 2011-09-13T13:26:33Z
A comment from std.cstream: * Both std.c.stdio and std.stream are publicly imported by std.cstream. I suppose this makes *some* kind of sense, if you think of std.cstream as an alternative, and not a complement, to std.stdio.
Comment #4 by rbanderton — 2014-06-06T14:41:21Z
Comment #5 by rbanderton — 2014-06-06T14:42:31Z
(In reply to Blake Anderton from comment #4) > https://github.com/D-Programming-Language/phobos/pull/2230 Disregard, this is for https://issues.dlang.org/show_bug.cgi?id=6644 instead.
Comment #6 by b2.temp — 2015-11-21T14:05:40Z
invalid, see pantaleev comment.