svn commit: samba r14750 - in trunk/source: include lib

jra at samba.org jra at samba.org
Tue Mar 28 15:49:58 GMT 2006


Author: jra
Date: 2006-03-28 15:49:57 +0000 (Tue, 28 Mar 2006)
New Revision: 14750

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14750

Log:
Use the noreturn attribute to try and tell coverity that
smb_panic can't return.
Jeremy.

Modified:
   trunk/source/include/includes.h
   trunk/source/lib/util.c


Changeset:
Modified: trunk/source/include/includes.h
===================================================================
--- trunk/source/include/includes.h	2006-03-28 13:44:42 UTC (rev 14749)
+++ trunk/source/include/includes.h	2006-03-28 15:49:57 UTC (rev 14750)
@@ -1554,4 +1554,13 @@
 #define CONST_DISCARD(type, ptr)      ((type) ((void *) (ptr)))
 #define CONST_ADD(type, ptr)          ((type) ((const void *) (ptr)))
 
+#ifndef NORETURN_ATTRIBUTE
+#if (__GNUC__ >= 3)
+#define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
+#else
+#define NORETURN_ATTRIBUTE
+#endif
+#endif
+
+void smb_panic( const char *why ) NORETURN_ATTRIBUTE ;
 #endif /* _INCLUDES_H */

Modified: trunk/source/lib/util.c
===================================================================
--- trunk/source/lib/util.c	2006-03-28 13:44:42 UTC (rev 14749)
+++ trunk/source/lib/util.c	2006-03-28 15:49:57 UTC (rev 14750)
@@ -1542,14 +1542,6 @@
 }
 
 /*******************************************************************
- legacy wrapper for smb_panic2()
-********************************************************************/
-void smb_panic( const char *why )
-{
-	smb_panic2( why, True );
-}
-
-/*******************************************************************
  Something really nasty happened - panic !
 ********************************************************************/
 
@@ -1557,7 +1549,7 @@
 #include <libexc.h>
 #endif
 
-void smb_panic2(const char *why, BOOL decrement_pid_count )
+static void smb_panic2(const char *why, BOOL decrement_pid_count )
 {
 	char *cmd;
 	int result;
@@ -1664,6 +1656,17 @@
 }
 
 /*******************************************************************
+ wrapper for smb_panic2()
+********************************************************************/
+
+ void smb_panic( const char *why )
+{
+	smb_panic2( why, True );
+	/* Notreached. */
+	abort();
+}
+
+/*******************************************************************
   A readdir wrapper which just returns the file name.
  ********************************************************************/
 



More information about the samba-cvs mailing list