Ok.  From the MSDN (Which is available for free perusal from
msdn.microsoft.com):

--Begin M$ Technobabble--
The ANSI assert macro is typically used to identify logic errors during
program development, by implementing the expression argument to evaluate to
false only when the program is operating incorrectly. After debugging is
complete, assertion checking can be turned off without modifying the source
file by defining the identifier NDEBUG. NDEBUG can be defined with a /D
command-line option or with a #define directive. If NDEBUG is defined with
#define, the directive must appear before ASSERT.H is included.

assert prints a diagnostic message when expression evaluates to false (0)
and calls abort to terminate program execution. No action is taken if
expression is true (nonzero). The diagnostic message includes the failed
expression and the name of the source file and line number where the
assertion failed.
--snip--
The assert routine is available in both the release and debug versions of
the C run-time libraries. Two other assertion macros, _ASSERT and _ASSERTE,
are also available, but they only evaluate the expressiosn passed to them
when the _DEBUG flag has been defined.
--End M$ Technobabble--

I think the key here is that NDEBUG must be defined before the #include
"assert.h" in order to disable assertions.

I personally don't care which assert is used under Windows.  I don't really
have time to test the VC++ build right now either, however, please remember
that while that whole discussion was going on the majority of the American
continents were asleep.  And it's the North Americans that _must_ use
Microsoft products due to obsolete management and too much marketing hype.

Joseph
Who has become aware that the majority of traffic on these two lists happens
when I'm asleep.


> -----Original Message-----
> From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 15, 2002 5:34 AM
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-dev
> Subject: [PHP-DEV] Re: [PHP-CVS] Re: cvs: php4 /main php.h
>
>
> [EMAIL PROTECTED] wrote:
> > On Fri, 15 Mar 2002, Yasuo Ohgaki wrote:
> >
> >
> >>According to Derick's post, VC defines NDEBUG somewhere else.
> >>Following patch should fix "redfined" warnings.
> >
> >
> > This doesn't seem like a good idea, VC++ might be using NDEBUG for very
> > different reasons. How did you come up with the name NDEBUG?
>
> Accoding to ISO9899(ANSI C) standard, NDEBUG is used for assert.h.
> VC may define/use it some other reasons? I just don't have any idea.
>
> >
> >>Do I need "#define assert(expr)  ASSERT(expr)" also for VC?
> >
> >
> > I've no idea, sebastian?
> >
>
> I hope someone confirm how it should be treated under VC.
>
> --
> Yasuo Ohgaki
>
> > Derick
> >
> >
> >
> >>--- php.h.~1.161.~  Fri Mar 15 15:36:56 2002
> >>+++ php.h   Fri Mar 15 18:47:43 2002
> >>@@ -63,18 +63,18 @@
> >>
> >>  #include "php_regex.h"
> >>
> >>-#ifndef PHP_WIN32
> >>  #if HAVE_ASSERT_H
> >>  #if PHP_DEBUG
> >>  #undef NDEBUG
> >>  #else
> >>+#ifndef NDEBUG
> >>  #define NDEBUG
> >>+#endif /* NDEBUG */
> >>  #endif
> >>  #include <assert.h>
> >>  #else /* HAVE_ASSERT_H */
> >>  #define assert(expr) ((void) (0))
> >>  #endif /* HAVE_ASSERT_H */
> >>-#endif /* PHP_WIN32 */
> >>
> >>  #define APACHE 0
> >>
> >>
> >>
> >>
> >>--
> >>PHP CVS Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
> > -----------------------------------------------------------------------
> >               PHP: Scripting the Web - [EMAIL PROTECTED]
> >                 All your branches are belong to me!
> >             SRM: Site Resource Manager - www.vl-srm.net
> > -----------------------------------------------------------------------
> >
>
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to