From e46b483c58ec3cfc01d2800c069eadc90166eb04 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 18 Nov 2011 23:06:46 -0800 Subject: Mark usage() as not returning to clear incorrect uninit var warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bdftruncate.c: In function ‘main’: bdftruncate.c:119:16: warning: ‘threshold’ may be used uninitialized in this function (It's not actually, if you consider that usage() exits when parse_threshold fails.) Signed-off-by: Alan Coopersmith --- bdftruncate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bdftruncate.c b/bdftruncate.c index 749869b..2b317c0 100644 --- a/bdftruncate.c +++ b/bdftruncate.c @@ -41,8 +41,15 @@ #include #include +#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ + || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define ATTR_NORETURN __attribute((noreturn)) +#else +# define ATTR_NORETURN +#endif /* GNUC */ + static int iswide(unsigned int); -static void usage(void); +static void usage(void) ATTR_NORETURN; static int parse_threshold(const char *str, unsigned long *threshold); static int -- cgit v1.2.1