|
From: Damien A <g_...@ho...> - 2003-10-10 10:08:12
|
<html><div style='background-color:'><DIV>
<P><BR><BR></P>
<DIV></DIV>
<P><BR><BR></P></DIV>
<DIV></DIV>
<DIV></DIV><?xml:namespace prefix = mailto /><mailto:dev...@li...?subject=help><mailto:dev...@li...><mailto:dev...@li...?subject=subscribe><mailto:dev...@li...?subject=unsubscribe>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>1)After checking the assert.h header file included in cygwin, I saw this
<DIV></DIV>
<P>/*<BR> assert.h<BR>*/</P>
<DIV></DIV>
<P>#ifdef __cplusplus<BR>extern "C" {<BR>#endif</P>
<DIV></DIV>
<P>#include "_ansi.h"</P>
<DIV></DIV>
<P>#undef assert</P>
<DIV></DIV>
<P>#ifdef NDEBUG /* required by ANSI standard */<BR>#define assert(p) ((void)0)<BR>#else</P>
<DIV></DIV>
<P>So you see why it still compiled even without being in debug mode. You are required to define NDEBUG.</P>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>2) Different compilers handle assert differently, but in this case, the message is sent to the console window, so I suggest running the program from the console and see the result. If you have VC++6, try this program.
<DIV></DIV>
<P>#define WIN32_LEAN_AND_MEAN<BR>#include <windows.h><BR>#include <stdlib.h><BR>#include <cassert><BR>int __stdcall WinMain(HINSTANCE,HINSTANCE,LPSTR,int)<BR>{<BR> int a=5;<BR> int b=1;<BR> assert(a<b);<BR> system ("PAUSE");<BR> return 0;<BR>}</P>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<P>It'll give you the message box you so desire :)</P>
<P>------------------------------------------------------- </P>
<DIV></DIV>
<DIV></DIV>This SF.net email is sponsored by: SF.net Giveback Program.
<DIV></DIV>
<DIV></DIV>SourceForge.net hosts over 70,000 Open Source Projects.
<DIV></DIV>
<DIV></DIV>See the people who have HELPED US provide better services:
<DIV></DIV>
<DIV></DIV>Click here: http://sourceforge.net/supporters.php
<DIV></DIV>
<DIV></DIV>_______________________________________________
<DIV></DIV>
<DIV></DIV>Dev-cpp-users mailing list
<DIV></DIV>
<DIV></DIV>Dev...@li...
<DIV></DIV>
<DIV></DIV>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
<DIV></DIV>
<DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV>
<DIV></DIV></mailto:dev...@li...?subject=unsubscribe></mailto:dev...@li...?subject=subscribe></mailto:dev...@li...></mailto:dev...@li...?subject=help></div><br clear=all><hr>Help STOP SPAM with <a href="http://g.msn.com/8HMBEN/2731??PS=">the new MSN 8 </a> and get 2 months FREE*</html>
|