digitalmars.D.learn - core.stdc.stdio.stderr != std.stdio.stderr ?
- bearophile (12/12) Aug 19 2011 Is this all correct?
- Steven Schveighoffer (5/18) Aug 19 2011 Yes, std.stdio.stderr is a D File struct, whereas core.stdc.stdio.stderr...
- David Nadlinger (4/10) Aug 19 2011 std.stdio.stderr is a wrapper around core.stdc.stdio.stderr (a D File),
Is this all correct?
static import core.stdc.stdio;
static import std.stdio;
void main() {
    std.stdio.fprintf(core.stdc.stdio.stderr, "Error\n"); // OK
    std.stdio.fprintf(std.stdio.stderr, "Error\n"); // line 5, error
}
The latest DMD gives:
test.d(5): Error: function core.stdc.stdio.fprintf (shared(_iobuf)* stream, in
const(char*) format,...) is not callable using argument types (File,string)
test.d(5): Error: cannot implicitly convert expression (stderr) of type File to
shared(_iobuf)*
Bye,
bearophile
 Aug 19 2011
On Fri, 19 Aug 2011 10:12:11 -0400, bearophile <bearophileHUGS lycos.com>  
wrote:
 Is this all correct?
 static import core.stdc.stdio;
 static import std.stdio;
 void main() {
     std.stdio.fprintf(core.stdc.stdio.stderr, "Error\n"); // OK
     std.stdio.fprintf(std.stdio.stderr, "Error\n"); // line 5, error
 }
 The latest DMD gives:
 test.d(5): Error: function core.stdc.stdio.fprintf (shared(_iobuf)*  
 stream, in const(char*) format,...) is not callable using argument types  
 (File,string)
 test.d(5): Error: cannot implicitly convert expression (stderr) of type  
 File to shared(_iobuf)*
Yes, std.stdio.stderr is a D File struct, whereas core.stdc.stdio.stderr  
is a C FILE * opaque type.
-Steve
 Aug 19 2011
On 8/19/11 4:12 PM, bearophile wrote:
 static import core.stdc.stdio;
 static import std.stdio;
 void main() {
      std.stdio.fprintf(core.stdc.stdio.stderr, "Error\n"); // OK
      std.stdio.fprintf(std.stdio.stderr, "Error\n"); // line 5, error
 }
std.stdio.stderr is a wrapper around core.stdc.stdio.stderr (a D File), 
you can use std.stdio.stderr.getFP() to get the C FILE pointer from it.
David
 Aug 19 2011








 
  
  
 
 "Steven Schveighoffer" <schveiguy yahoo.com>
 "Steven Schveighoffer" <schveiguy yahoo.com> 