Thread overview
[Issue 7729] fileno conflict
Jan 25, 2015
AndyC
Jan 25, 2015
Jacob Carlborg
Jan 26, 2015
Jacob Carlborg
Jan 27, 2015
AndyC
Jul 10, 2017
RazvanN
Jul 10, 2017
RazvanN
January 25, 2015
https://issues.dlang.org/show_bug.cgi?id=7729

AndyC <andy@squeakycode.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andy@squeakycode.net

--- Comment #1 from AndyC <andy@squeakycode.net> ---
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?

--
January 25, 2015
https://issues.dlang.org/show_bug.cgi?id=7729

--- Comment #2 from Jacob Carlborg <doob@me.com> ---
(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.

--
January 26, 2015
https://issues.dlang.org/show_bug.cgi?id=7729

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #3 from Steven Schveighoffer <schveiguy@yahoo.com> ---
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.

--
January 26, 2015
https://issues.dlang.org/show_bug.cgi?id=7729

--- Comment #4 from Jacob Carlborg <doob@me.com> ---
(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).

--
January 27, 2015
https://issues.dlang.org/show_bug.cgi?id=7729

--- Comment #5 from AndyC <andy@squeakycode.net> ---
This code compiles fine on windows:

import std.stdio;
import core.stdc.stdio;

void main ()
{
    FILE* f;
    fileno(f);
}

--
January 27, 2015
https://issues.dlang.org/show_bug.cgi?id=7729

--- Comment #6 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(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).

--
July 10, 2017
https://issues.dlang.org/show_bug.cgi?id=7729

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #7 from RazvanN <razvan.nitu1305@gmail.com> ---
Cannot reproduce on Ubuntu 16.04 with latest dmd.

--
July 10, 2017
https://issues.dlang.org/show_bug.cgi?id=7729

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--
July 10, 2017
https://issues.dlang.org/show_bug.cgi?id=7729

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |FIXED

--- Comment #8 from Steven Schveighoffer <schveiguy@yahoo.com> ---
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.

--