assert() and NDEBUG 
Author Message
 assert() and NDEBUG

If NDEBUG is defined, is assert() actually called, or does it disappear
from your code entirely?

--
David Scarlett

Remove "eminemsucks" to reply via email.



Fri, 04 Feb 2005 20:07:01 GMT  
 assert() and NDEBUG

Quote:

> If NDEBUG is defined, is assert() actually called, or does it disappear
> from your code entirely?

From the last public draft of C99:

#    If NDEBUG is defined as
#    a  macro  name  at  the  point  in  the  source  file  where
#    <assert.h> is included, the assert macro is  defined  simply
#    as
#
#            #define assert(ignore) ((void)0)

Richard



Fri, 04 Feb 2005 21:43:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. assert, NDEBUG and GCC

2. NDEBUG useless?

3. longjmp() from signal handler (was: NDEBUG useless?)

4. _ASSERT, assert, ASSERT and ATLASSERT

5. Difference between assert and ASSERT?

6. ASSERT and assert

7. Difference between assert and ASSERT?

8. CPropertySheet Asserting but no Assert Dialog Box

9. ASSERT vs. assert()

10. Debug.Assert in MC++

11. DEBUG ASSERT Error????

12. Handling assert's

 

 
Powered by phpBB® Forum Software