[Piglit] [PATCH] util: Mark piglit_report_result with noreturn attribute.

Vinson Lee vlee at freedesktop.org
Mon Feb 10 21:53:02 PST 2014


This silences several false compiler warnings with Clang.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-util.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 96b31d5..14abd69 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -84,6 +84,14 @@ lround(double x) {
 #define PRINTFLIKE(f, a)
 #endif
 
+#if defined(__GNUC__)
+#define NORETURN __attribute__((noreturn))
+#elif defined(_MSC_VER)
+#define NORETURN __declspec(noreturn)
+#else
+#define NORETURN
+#endif
+
 #ifndef HAVE_ASPRINTF
 int asprintf(char **strp, const char *fmt, ...) PRINTFLIKE(2, 3);
 #endif /* HAVE_ASPRINTF */
@@ -142,7 +150,7 @@ bool piglit_is_extension_in_array(const char **haystack, const char *needle);
 int piglit_find_line(const char *program, int position);
 void piglit_merge_result(enum piglit_result *all, enum piglit_result subtest);
 const char * piglit_result_to_string(enum piglit_result result);
-void piglit_report_result(enum piglit_result result);
+void piglit_report_result(enum piglit_result result) NORETURN;
 void piglit_report_subtest_result(enum piglit_result result,
 				  const char *format, ...) PRINTFLIKE(2, 3);
 
-- 
1.8.5.3



More information about the Piglit mailing list