www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1559] New: version statement makes code outside of it disappear

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: torhu 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.


-- 
Oct 09 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1559


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.031 and 2.015


-- 
Jun 22 2008