[Issue 1067] New: release flag kills Win32 applications without unittest flag?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 17 23:50:23 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1067

           Summary: release flag kills Win32 applications without unittest
                    flag?
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: rpgfan3233 at gmail.com


I've tried creating a simple window using CreateWindowA() from the Win32 API.
When I compile without the release switch (-release), everything runs fine. I
add the unittest (-unittest) switch and the program still runs fine. However,
if you don't include the unittest switch and you DO include the release switch,
the window is not displayed, and runs in the background. I tried compiling with
warnings on as well. No warnings were generated.

dmd mywin gdi32.lib mywin.def ;OK
dmd mywin gdi32.lib mywin.def -unittest ;OK
dmd mywin gdi32.lib mywin.def -release ;NOT OK
dmd mywin gdi32.lib mywin.def -release -w ;NOT OK with no warnings displayed
dmd mywin gdi32.lib mywin.def -release -unittest ;OK

I ended up going into the dmd\samples\d directory and compiling the winsamp.d
file the same way I tried compiling mine. The results were the same, other than
the fact that using the -w flag, I found that there was no default case for the
nested switch statement in "case WM_COMMAND" in winsamp.d::WindowProc - "switch
(LOWORD(wParam))". I added a default case, and it then compiled without
warnings.

Is this the way the release switch is supposed to work? Unit tests aren't
required, are they?


-- 



More information about the Digitalmars-d-bugs mailing list