diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-06 18:30:26 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-06 18:30:26 -0700 |
commit | 84ce81476ac32a9c79935e9666ee96d38d7ed600 (patch) | |
tree | ab75237a752206eb34b862ab6444f829e17107e2 | |
parent | 7e7820d859a779efcf9e7824d6cc6df4c0d325a7 (diff) |
Mark FatalError _X_NORETURN
This removes a false-positive from static analysis results.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | iso2022.c | 19 | ||||
-rw-r--r-- | luit.c | 4 | ||||
-rw-r--r-- | luit.h | 10 |
3 files changed, 12 insertions, 21 deletions
@@ -41,25 +41,6 @@ THE SOFTWARE. static unsigned char buffered_input[BUFFERED_INPUT_SIZE]; static int buffered_input_count = 0; -static void -FatalError(const char *f,...) -{ - va_list args; - va_start(args, f); - vfprintf(stderr, f, args); - va_end(args); - ExitProgram(1); -} - -static void -ErrorF(const char *f,...) -{ - va_list args; - va_start(args, f); - vfprintf(stderr, f, args); - va_end(args); -} - #define OUTBUF_FREE(is, count) ((is)->outbuf_count + (count) <= BUFFER_SIZE) #define OUTBUF_MAKE_FREE(is, fd, count) \ if(!OUTBUF_FREE((is), (count))) outbuf_flush((is), (fd)) @@ -66,7 +66,7 @@ static volatile int sigchld_queued = 0; static int convert(int, int); static int condom(int, char **); -static void +void ErrorF(const char *f,...) { va_list args; @@ -75,7 +75,7 @@ ErrorF(const char *f,...) va_end(args); } -static void +void FatalError(const char *f,...) { va_list args; @@ -33,4 +33,14 @@ extern int olog; void child(char *, char *, char *const *); void parent(int, int); +void ErrorF(const char *f,...); + +/* Not using _X_NORETURN since that would pull in extra dependencies */ +#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ + || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +void FatalError(const char *f,...) __attribute((noreturn)); +#else +void FatalError(const char *f,...); +#endif + #endif /* LUIT_LUIT_H */ |