On 02/10/2014 09:53 PM, Vinson Lee wrote: > This silences several false compiler warnings with Clang.
At some point someone may try to compile this on an ancient GCC that doesn't have noreturn, but that guy can submit a patch to fix it. :) Reviewed-by: Ian Romanick <[email protected]> > Signed-off-by: Vinson Lee <[email protected]> > --- > 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); > _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
