[PATCH:libXt 3/6] Mark non-returning function with appropriate attribute.

Thomas Klausner wiz at NetBSD.org
Tue Jun 25 14:02:47 PDT 2013


---
 src/Error.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Error.c b/src/Error.c
index fc9b11a..334e001 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -75,6 +75,13 @@ in this Software without prior written authorization from The Open Group.
 #include <stdio.h>
 #include <stdlib.h>
 
+#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  */
+
 /* The error handlers in the application context aren't used since we can't
    come up with a uniform way of using them.  If you can, define
    GLOBALERRORS to be FALSE (or 0). */
@@ -89,7 +96,7 @@ static XrmDatabase errorDB = NULL;
 static Boolean error_inited = FALSE;
 void _XtDefaultErrorMsg(String, String, String, String, String*, Cardinal*);
 void _XtDefaultWarningMsg(String, String, String, String, String*, Cardinal*);
-void _XtDefaultError(String);
+void _XtDefaultError(String) ATTR_NORETURN;
 void _XtDefaultWarning(String);
 static XtErrorMsgHandler errorMsgHandler = _XtDefaultErrorMsg;
 static XtErrorMsgHandler warningMsgHandler = _XtDefaultWarningMsg;
-- 
1.8.3.1



More information about the xorg-devel mailing list