Skip to content

Commit

Permalink
x11-toolkits/open-motif*: fix build with clang 16
Browse files Browse the repository at this point in the history
Clang 16 has a new error about incompatible function types, which shows
up when building x11-toolkits/open-motif:

  WmError.c:134:24: error: incompatible function pointer types passing 'void (char *)' to parameter of type 'void (*)(String) __attribute__((noreturn))' (aka 'void (*)(char *) __attribute__((noreturn))') [-Wincompatible-function-pointer-types]
      XtSetErrorHandler (WmXtErrorHandler);
                         ^~~~~~~~~~~~~~~~
  /usr/local/include/X11/Intrinsic.h:1776:1: note: passing argument to parameter here
  );
  ^

In this case the declaration of the callback function for
XtSetErrorHandler() shoud have a noreturn attribute, specifically using
the _X_NORETURN macro.

PR:		271425
  • Loading branch information
DimitryAndric authored and cschuber committed May 15, 2023
1 parent 90eafe3 commit 72d0d9b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions x11-toolkits/open-motif-devel/files/patch-clients_mwm_WmError.h
@@ -0,0 +1,11 @@
--- clients/mwm/WmError.h.orig 2017-08-17 00:38:43 UTC
+++ clients/mwm/WmError.h
@@ -32,7 +32,7 @@ extern int WmXIOErrorHandler (Display *display);
extern void WmInitErrorHandler (Display *display);
extern int WmXErrorHandler (Display *display, XErrorEvent *errorEvent);
extern int WmXIOErrorHandler (Display *display);
-extern void WmXtErrorHandler (char *message);
+extern void WmXtErrorHandler (char *message) _X_NORETURN;
extern void WmXtWarningHandler (char *message);
extern void Warning (char *message);
#ifndef NO_MESSAGE_CATALOG
11 changes: 11 additions & 0 deletions x11-toolkits/open-motif/files/patch-clients_mwm_WmError.h
@@ -0,0 +1,11 @@
--- clients/mwm/WmError.h.orig 2017-08-17 00:38:43 UTC
+++ clients/mwm/WmError.h
@@ -32,7 +32,7 @@ extern int WmXIOErrorHandler (Display *display);
extern void WmInitErrorHandler (Display *display);
extern int WmXErrorHandler (Display *display, XErrorEvent *errorEvent);
extern int WmXIOErrorHandler (Display *display);
-extern void WmXtErrorHandler (char *message);
+extern void WmXtErrorHandler (char *message) _X_NORETURN;
extern void WmXtWarningHandler (char *message);
extern void Warning (char *message);
#ifndef NO_MESSAGE_CATALOG

0 comments on commit 72d0d9b

Please sign in to comment.