summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-06 18:30:26 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-05-06 18:30:26 -0700
commit84ce81476ac32a9c79935e9666ee96d38d7ed600 (patch)
treeab75237a752206eb34b862ab6444f829e17107e2
parent7e7820d859a779efcf9e7824d6cc6df4c0d325a7 (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.c19
-rw-r--r--luit.c4
-rw-r--r--luit.h10
3 files changed, 12 insertions, 21 deletions
diff --git a/iso2022.c b/iso2022.c
index 1e551d5..0613100 100644
--- a/iso2022.c
+++ b/iso2022.c
@@ -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))
diff --git a/luit.c b/luit.c
index 6bd8775..0ece7b6 100644
--- a/luit.c
+++ b/luit.c
@@ -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;
diff --git a/luit.h b/luit.h
index 39be5d2..ccb1701 100644
--- a/luit.h
+++ b/luit.h
@@ -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 */