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

Status
RESOLVED
Resolution
INVALID
Severity
trivial
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-10-20T11:00:00Z
Last change time
2012-07-09T08:59:56Z
Assigned to
nobody
Creator
jlquinn

Comments

Comment #0 by jlquinn — 2011-10-20T11:00:13Z
import std.stdio; import std.c.stdio; void foo() { File f = stdin; int c = getc(f.getFP()); } ~/dmd2/linux/bin64/dmd stdiobug.d stdiobug.d(5): Error: std.stdio.stdin at /home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/stdio.d(2191) conflicts with core.stdc.stdio.stdin at /home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdio.di(262) My thought is that the names for stdin should be different. Otherwise it makes it harder to use both stdio and c library features together.
Comment #1 by hsteoh — 2012-02-24T21:33:16Z
You could just use std.stdio.stdin and std.c.stdio.stdin to disambiguate. Or use aliases to map them to shorter names.
Comment #2 by goughy — 2012-02-29T15:39:06Z
This unfortunately catches rdmd also... D:\devel\temp>rdmd --loop="writeln(line)" Notice: As of Phobos 2.058, std.ctype has been deprecated. It will be removed in July 2012. Please use std.ascii instead. Notice: As of Phobos 2.055, std.regexp has been deprecated. It will be removed in February 2012. Please use std.regex instead . C:\Users\ANDREW~1.TOL\AppData\Local\Temp\.rdmd\eval.5E969AE088F3A4182B17437CCE838A8E.d(16): Error: std.stdio.stdin at D:\dmd2 \windows\bin\..\..\src\phobos\std\stdio.d(2243) conflicts with core.stdc.stdio.stdin at D:\dmd2\windows\bin\..\..\src\druntim e\import\core\stdc\stdio.di(246) DMD 2.058
Comment #3 by lovelydear — 2012-04-19T07:43:11Z
This works. import std.stdio; import std.c.stdio; void foo() { File f = std.stdio.stdin; int c = std.c.stdio.getc(f.getFP()); } as well as that: import std.stdio:stdin, File; import std.c.stdio:getc; void foo() { File f = stdin; int c = getc(f.getFP()); } So this is not a bug, it's a case of not understanding the use of packages. I think it should be closed.
Comment #4 by hsteoh — 2012-04-20T17:28:24Z
Can't wait for the new std.io to get into phobos, then all of this will be a non-issue.
Comment #5 by yebblies — 2012-07-09T08:59:56Z
This is not a bug.