"fileno" declared in std.stdio conflicts with the one declared in core.stdc.stdio. Removing the following line should fix the problem: https://github.com/D-Programming-Language/phobos/blob/master/std/stdio.d#L38
I'm not sure how to test this. Is this a good test? // file test.d: import std.stdio; import core.stdc.stdio; void main() { File f = File("test.d", "r"); writeln( f.fileno() ); } This compiles and runs fine. Is this still a problem? Can you post some sample code?
(In reply to AndyC from comment #1) > Is this still a problem? Can you post some sample code? import std.stdio; import core.stdc.stdio; void main () { FILE* f; fileno(f); } The error message I get: main.d(7,11): Error: core.stdc.stdio.fileno at ~/.dvm/compilers/dmd-2.066.1/osx/bin/../../src/druntime/import/core/stdc/stdio.d(773,10) conflicts with core.sys.posix.stdio.fileno at ~/.dvm/compilers/dmd-2.066.1/osx/bin/../../src/druntime/import/core/sys/posix/stdio.d(192,8) So actually now it's a conflict between core.stdc.stdio and core.sys.posix.stdio.
So maybe this is Posix only? I'm curious actually, how come these conflict? Both are extern(C), so they are pointing at the same symbol.
(In reply to Steven Schveighoffer from comment #3) > So maybe this is Posix only? > > I'm curious actually, how come these conflict? Both are extern(C), so they > are pointing at the same symbol. Yeah, but does the compiler know that? Or rather, I don't think it uses different rules for looking up symbols depending on if they're extern(C).
This code compiles fine on windows: import std.stdio; import core.stdc.stdio; void main () { FILE* f; fileno(f); }
(In reply to AndyC from comment #5) > This code compiles fine on windows: Right, because Windows does not import or declare anything via core.sys.posix. The bug is posix-only (there isn't a drop-down for that though).
Cannot reproduce on Ubuntu 16.04 with latest dmd.
The alias was removed here: https://github.com/dlang/phobos/pull/2809 So it was actually fixed before Jacob's test in January of 2015, but hadn't made it into the released compiler yet.