Mark FatalError _X_NORETURN

This removes a false-positive from static analysis results.
Signed-off-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston <jeremyhu@apple.com>
parent 7e7820d8
...@@ -41,25 +41,6 @@ THE SOFTWARE. ...@@ -41,25 +41,6 @@ THE SOFTWARE.
static unsigned char buffered_input[BUFFERED_INPUT_SIZE]; static unsigned char buffered_input[BUFFERED_INPUT_SIZE];
static int buffered_input_count = 0; 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_FREE(is, count) ((is)->outbuf_count + (count) <= BUFFER_SIZE)
#define OUTBUF_MAKE_FREE(is, fd, count) \ #define OUTBUF_MAKE_FREE(is, fd, count) \
if(!OUTBUF_FREE((is), (count))) outbuf_flush((is), (fd)) if(!OUTBUF_FREE((is), (count))) outbuf_flush((is), (fd))
......
...@@ -66,7 +66,7 @@ static volatile int sigchld_queued = 0; ...@@ -66,7 +66,7 @@ static volatile int sigchld_queued = 0;
static int convert(int, int); static int convert(int, int);
static int condom(int, char **); static int condom(int, char **);
static void void
ErrorF(const char *f,...) ErrorF(const char *f,...)
{ {
va_list args; va_list args;
...@@ -75,7 +75,7 @@ ErrorF(const char *f,...) ...@@ -75,7 +75,7 @@ ErrorF(const char *f,...)
va_end(args); va_end(args);
} }
static void void
FatalError(const char *f,...) FatalError(const char *f,...)
{ {
va_list args; va_list args;
......
...@@ -33,4 +33,14 @@ extern int olog; ...@@ -33,4 +33,14 @@ extern int olog;
void child(char *, char *, char *const *); void child(char *, char *, char *const *);
void parent(int, int); 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 */ #endif /* LUIT_LUIT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment