util: use SMB_ASSERT with panic also in non-developer builds !!!
authorMichael Adam <obnox@samba.org>
Fri, 11 May 2012 14:42:33 +0000 (16:42 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 11 May 2012 18:16:38 +0000 (20:16 +0200)
This has been around since a long time: In non-developer builds,
we don't panic in SMB_ASSERT but happly continue with the error
condition, which is ridiculous and dangerous...

lib/util/samba_util.h

index f5577e6d8ef1588d849317eb6547f96d306f69e3..f4ffe6472caedd29016d87d7c7fe6f784f3d02c0 100644 (file)
@@ -45,7 +45,6 @@ extern const char *panic_action;
 /**
  * assert macros 
  */
-#ifdef DEVELOPER
 #define SMB_ASSERT(b) \
 do { \
        if (!(b)) { \
@@ -54,12 +53,6 @@ do { \
                smb_panic("assert failed: " #b); \
        } \
 } while(0)
-#else
-/* redefine the assert macro for non-developer builds */
-#define SMB_ASSERT(b) do { if (!(b)) { \
-        DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
-           __FILE__, __LINE__, #b)); }} while (0)
-#endif
 
 #ifndef ABS
 #define ABS(a) ((a)>0?(a):(-(a)))