]> git.ozlabs.org Git - ccan/blobdiff - ccan/compiler/compiler.h
talloc: spelling fix.
[ccan] / ccan / compiler / compiler.h
index d57d814b3711213c978602cd46c7c6e2e67ccf7d..1e0d8efbaacc1be66aa291f861560a513b69887a 100644 (file)
 #define COLD
 #endif
 
+#if HAVE_ATTRIBUTE_NORETURN
+/**
+ * NORETURN - a function does not return
+ *
+ * Used to mark a function which exits; useful for suppressing warnings.
+ *
+ * Example:
+ * static void NORETURN fail(const char *reason)
+ * {
+ *     fprintf(stderr, "Error: %s (%s)\n", reason, strerror(errno));
+ *     exit(1);
+ * }
+ */
+#define NORETURN __attribute__((noreturn))
+#else
+#define NORETURN
+#endif
+
 #if HAVE_ATTRIBUTE_PRINTF
 /**
  * PRINTF_FMT - a function takes printf-style arguments