Module Name:    src
Committed By:   joerg
Date:           Fri Aug  8 19:43:49 UTC 2014

Modified Files:
        src/sys/sys: cdefs.h

Log Message:
Add __unreachable(), which can be used to mark dead branches when the
compiler can't tell side effects.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/sys/cdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.120 src/sys/sys/cdefs.h:1.121
--- src/sys/sys/cdefs.h:1.120	Mon Jul 14 18:50:22 2014
+++ src/sys/sys/cdefs.h	Fri Aug  8 19:43:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.120 2014/07/14 18:50:22 plunky Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.121 2014/08/08 19:43:49 joerg Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -296,6 +296,12 @@
 #define	__noprofile	/* nothing */
 #endif
 
+#if __GNUC_PREREQ__(4, 6) || defined(__clang__)
+#define	__unreachable()	__builtin_unreachable()
+#else
+#define	__unreachable()	do {} while (0)
+#endif
+
 #if defined(__cplusplus)
 #define	__BEGIN_EXTERN_C	extern "C" {
 #define	__END_EXTERN_C		}

Reply via email to