D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6663 - std.stdio conflicts with core.stdc.stdio
Summary: std.stdio conflicts with core.stdc.stdio
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 12:21 UTC by Jerry Quinn
Modified: 2020-03-21 03:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2011-09-13 12:21:08 UTC
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 Vladimir Panteleev 2011-09-13 12:35:47 UTC
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 Jerry Quinn 2011-09-13 13:14:05 UTC
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 Vladimir Panteleev 2011-09-13 13:26:33 UTC
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 5 Blake Anderton 2014-06-06 14:42:31 UTC
(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 basile-z 2015-11-21 14:05:40 UTC
invalid, see pantaleev comment.