http://d.puremagic.com/issues/show_bug.cgi?id=5251
Summary: Const C file Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-11-21 16:31:32 PST --- I think this program is supposed to work, because fprintf() and fclose() don't modify 'fout': import std.c.stdio: fopen, fclose, fprintf; void main() { const fout = fopen("test.txt", "w"); fprintf(fout, "%d", 10); // ERR fclose(fout); // ERR } But DMD 2.050 shows the errors: test.d(4): Error: function core.stdc.stdio.fprintf (shared(_iobuf)* stream, in const(char*) format,...) is not callable using argument types (const(shared(const(_iobuf))*),string,int) test.d(4): Error: cannot implicitly convert expression (fout) of type const(shared(const(_iobuf))*) to shared(_iobuf)* test.d(5): Error: function core.stdc.stdio.fclose (shared(_iobuf)* stream) is not callable using argument types (const(shared(const(_iobuf))*)) test.d(5): Error: cannot implicitly convert expression (fout) of type const(shared(const(_iobuf))*) to shared(_iobuf)* -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------