<br><br><div class="gmail_quote">On Tue, Apr 26, 2011 at 10:29 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 26 April 2011 19:01, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Apr 26, 2011 at 6:21 AM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 26 April 2011 04:03, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, Apr 25, 2011 at 6:39 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On 26 April 2011 03:05, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Hi guys. I don&#39;t know why but with CMakeVMMaker the asserts are not working.  I can see the flags are being set correct in CmakeList.txt:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; add_definitions(-arch i386 -mmacosx-version-min=10.5 -g3 -O0 -msse3 -funroll-loops -fasm-blocks -finline-functions -mfpmath=sse -march=pentium-m -falign-functions=16 -fno-gcse -fno-cse-follow-jumps -std=gnu99 -DBUILD_FOR_OSX -DUSE_INLINE_MEMORY_ACCESSORS -DLSB_FIRST -DHAVE_SYS_TIME_H -DHAVE_NANOSLEEP -DNDEBUG=1 -DDEBUGVM=1 -DCOGMTVM=1 -DUSE_GLOBAL_STRUCT=0 -DBASE_HEADER_SIZE=4 -DCOGVM)<br>

&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; AFAIK, code checks<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #ifdef NDEBUG<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; which means<br>
&gt;&gt; &gt;&gt; &#39;if defined NDEBUG&#39;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; and so it doesn&#39;t matters if it = 1 or = 0<br>
&gt;&gt; &gt;&gt; because it is defined, but don&#39;t cares which value.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Also,<br>
&gt;&gt; &gt;&gt; NDEBUG and DEBUGVM should be mutually exclusive?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; NO!!  NO!!  NO!!  [ :) ].  I said earlier, NDEBUG is a linux-ism for enabling asserts.  See /usr/include/assert.h.  So if defined(NDEBUG) assert(foo) does nothing, but if !defined(NDEBUG) assert(foo) prints a warning and in unix/linux aborts, but in Cog continues.<br>

&gt;&gt; &gt; DEBUGVM includes some extra code that allows break-pointing jumping from the interpreter into machien code.  Arguably it could be eliminated but it&#39;ll be useful when we port to new ISAs.<br>
&gt;&gt; &gt; I said all this last week.  Please take note this time :)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; But hey, i insist that they are mutually exclusive.<br>
&gt;<br>
&gt; You can insist all you like but you&#39;re wrong.  NDEBUG controls assertions and these are orthogonal to the enilopmart debugging introduced by using DEBUGVM.  Simple as that.  They are *not* mutually exclusive.<br>

&gt;<br>
<br>
</div>Eliot, i understand this stuff. Now you taking my words too literally.<br>
I meant to say that for existing cmake configurations they should be<br>
mutually exclusive.<br></blockquote><div><br></div><div>Ah, agreed :)  Sorry :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
But for current variants for release we should have:<br>
 a) turn debugging off  (-DDEBUGVM=0)<br>
 b) suppress assertions (-DNDEBUG)<br>
<br>
and when building VM for debugging we doing otherwise:<br>
 - turn all debugging on (-DDEBUGVM=1)<br>
 - enable assertions (omit defining -DNDEBUG)<br>
<br>
so in the above two configurations its easy to see that these two<br>
options are mutually exclusive.<br>
<br>
And of course, in case of need, one can create configuration where you<br>
can use different combination of these two flags, but the above two is<br>
most logical choice for release and debug versions of VM configs.<br>
<font color="#888888"><br>
<br>
--<br>
</font><div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br>