[Issue 1559] New: version statement makes code outside of it disappear
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Oct 9 05:11:57 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1559
Summary: version statement makes code outside of it disappear
Product: D
Version: 1.022
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: torhu at yahoo.com
---
// newbug.d
void main()
{
//int x; // FIX 1
printf("Do you see this?\n");
version(ANYTHING) { /* Doesn't matter if this block is empty or not */ }
else { /*printf("Now you do!");*/ } // FIX 2
}
--
Compiling and running it:
---
c:\prog\test\D\bugs>dmd -run newbug
c:\prog\test\D\bugs>
---
Nothing is printed, which suggests that the printf call is not compiled in.
Grepping the executable for 'printf' turns up empty.
Uncommenting the code in either line 'FIX 1' or 'FIX 2' makes the first printf
call work.
--
More information about the Digitalmars-d-bugs
mailing list