From 999d8e8d1e430c62b5237e885836830e5f8b8d73 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Sun, 18 Apr 2010 14:11:38 -0700 Subject: tet: Fix the remaining warnings. Add a TET_NORETURN attribute and tag various fatal functions with it. That fixes a few "int x; switch(...) { case C: x = blah; break; default: fatal() }" cases that result in uninitialized variable warnings. Signed-off-by: Aaron Plattner Acked-by: Peter Hutterer --- include/tet_api.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/tet_api.h b/include/tet_api.h index b81e2990..1f70e287 100644 --- a/include/tet_api.h +++ b/include/tet_api.h @@ -240,6 +240,12 @@ extern "C" { # define TET_PROTOLIST(list) () #endif +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205) +# define TET_NORETURN __attribute__((noreturn)) +#else +# define TET_NORETURN +#endif /* GNUC */ + /* NULL function pointer - may be used as an argument to tet_fork() */ #define TET_NULLFP ((void (*) ()) 0) @@ -304,7 +310,7 @@ extern "C" { /* functions in TETware-Lite and in Distrubuted TETware */ TET_IMPORT_FUNC(void, tet_delete, TET_PROTOLIST((int, char *))); -TET_IMPORT_FUNC(void, tet_exit, TET_PROTOLIST((int))); +TET_NORETURN TET_IMPORT_FUNC(void, tet_exit, TET_PROTOLIST((int))); TET_IMPORT_FUNC(char *, tet_getvar, TET_PROTOLIST((char *))); TET_IMPORT_FUNC(void, tet_infoline, TET_PROTOLIST((char *))); TET_IMPORT_FUNC(int, tet_kill, TET_PROTOLIST((pid_t, int))); -- cgit v1.2.3