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

Thomas Klausner wiz at NetBSD.org
Tue Jun 25 14:31:43 PDT 2013


On Tue, Jun 25, 2013 at 02:20:58PM -0700, Alan Coopersmith wrote:
> On 06/25/13 02:02 PM, Thomas Klausner wrote:
> >---
> >  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  */
> >+
> 
> We prefer to use _X_NORETURN from <X11/Xfuncproto.h> so we don't have to
> individually edit 100 modules when another compiler adds support for a
> given attribute.

Ok, attached.

Btw, what's the appropriate method to create a patch that's a merged
version of previous patches, which are separate commits in my local
copy of the repository? Just creating diffs against origin like I do
now creates patches in a different format. On the other hand, checking
out HEAD again, copying the change over and making a new commit is a
bit much effort. There must be an easier way.

Thanks,
 Thomas
-------------- next part --------------
diff --git a/src/Error.c b/src/Error.c
index fc9b11a..50f6c3c 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -89,7 +89,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) _X_NORETURN;
 void _XtDefaultWarning(String);
 static XtErrorMsgHandler errorMsgHandler = _XtDefaultErrorMsg;
 static XtErrorMsgHandler warningMsgHandler = _XtDefaultWarningMsg;


More information about the xorg-devel mailing list