[Issue 6319] New: Problem with prinft inside debug{} of pure function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 14 17:19:30 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6319
Summary: Problem with prinft inside debug{} of pure function
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-07-14 17:14:15 PDT ---
A D2 program:
import core.stdc.stdio;
void foo() pure {
debug {
if(true)
printf("********");
}
}
void main() {
foo();
}
If I compile it with -debug I DMD 2.054 it shows:
test.d(5): Error: pure function 'foo' cannot call impure function 'printf'
If I remove the if(true) line the program compiles and runs correctly:
import core.stdc.stdio;
void foo() pure {
debug {
printf("********");
}
}
void main() {
foo();
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list