www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6834] New: std.stdio conflicts with core.stdc.stdio

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834

           Summary: std.stdio conflicts with core.stdc.stdio
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jlquinn optonline.net



---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx



You could just use std.stdio.stdin and std.c.stdio.stdin to disambiguate. Or
use aliases to map them to shorter names.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834


goughy gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |goughy gmail.com



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Linux                       |All
           Severity|normal                      |trivial


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834




Can't wait for the new std.io to get into phobos, then all of this will be a
non-issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6834


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |INVALID



This is not a bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2012