[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

assert in release is available on windows

From: Barry Scott <barry_at_barrys-emacs.org>
Date: 2003-11-17 13:42:32 CET

At 17-11-2003 07:26, =?ISO-8859-2?Q?Branko_=C8ibej?= wrote:
>Windows, because MS in its wisdom thinks it shouldn't be done (witness
>the fact that support for "assert()" is absent in the release version of
>the C runtime library). On the other hand, they give you DrWatson, which
>is quite useless without debug info.

You control assert with the NDEBUG macro. If defined the asserts disappear,
which is the default for release build. This is same on Unix and Windows.

Barry

[l:\users\barry]
> type ass.c
#include <assert.h>
#include <stdlib.h>

int main()
         {
         assert( 0 );
         return 0;
         }

[l:\users\barry]
> cl ass.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

ass.c
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:ass.exe
ass.obj

[l:\users\barry]
> ass.exe
Assertion failed: 0, file ass.c, line 6

abnormal program termination

[l:\users\barry]
> cl /DNDEBUG ass.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

ass.c
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:ass.exe
ass.obj

[l:\users\barry]
> ass.exe

[l:\users\barry]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 17 13:43:32 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.