[PATCH:xfs 4/4] Add _X_NORETURN to declarations of functions that exit

Alan Coopersmith alan.coopersmith at oracle.com
Sat Sep 17 01:03:26 PDT 2011


While you might think FatalError() also should have _X_NORETURN, if
you add it, you will find that gcc warns you that it does indeed
return when built with syslog support.   Why syslog makes all fatal
errors become non-fatal is an excellent question to ponder...

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac |    3 ++-
 os/error.c   |    2 +-
 os/utils.c   |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index b6c7c48..a7c9b2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,7 +130,8 @@ fi
 AC_CHECK_FUNCS([daemon])
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XFS, xfont xtrans)
+#  - xproto >= 7.0.17 required for _X_NORETURN in <X11/Xfuncproto.h>
+PKG_CHECK_MODULES(XFS, xproto >= 7.0.17 xfont xtrans)
 
 # Transport selection macro from xtrans.m4
 XTRANS_CONNECTION_FLAGS
diff --git a/os/error.c b/os/error.c
index 4dc27a8..8d97547 100644
--- a/os/error.c
+++ b/os/error.c
@@ -66,7 +66,7 @@ Bool        log_open = FALSE;
 char        ErrorFile[PATH_MAX];
 static char	CurrentErrorFile[PATH_MAX];
 
-static void
+static void _X_NORETURN
 abort_server(void)
 {
     fflush(stderr);
diff --git a/os/utils.c b/os/utils.c
index 7aa2188..2ca608a 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -187,7 +187,7 @@ GetTimeInMillis(void)
     return ((tp.tv_sec * 1000) + (tp.tv_usec / 1000));
 }
 
-static void
+static void _X_NORETURN
 usage(void)
 {
     fprintf(stderr, "usage: %s [-config config_file] [-port tcp_port] [-droppriv] [-daemon] [-nodaemon] [-user user_name] [-ls listen_socket]\n",
-- 
1.7.3.2



More information about the xorg-devel mailing list