Bug 271425 - x11-toolkits/open-motif: fix build with clang 16
Summary: x11-toolkits/open-motif: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-14 19:36 UTC by Dimitry Andric
Modified: 2023-05-15 14:38 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
x11-toolkits/open-motif: fix build with clang 16 (1.72 KB, patch)
2023-05-14 19:36 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 19:36:15 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 19:36:35 UTC
Created attachment 242176 [details]
x11-toolkits/open-motif: fix build with clang 16
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-15 14:37:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=72d0d9b5dad67545e571057abd8d59166ce247b2

commit 72d0d9b5dad67545e571057abd8d59166ce247b2
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-15 14:17:12 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-05-15 14:36:17 +0000

    x11-toolkits/open-motif*: fix build with clang 16

    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

 .../open-motif-devel/files/patch-clients_mwm_WmError.h (new)  | 11 +++++++++++
 .../open-motif/files/patch-clients_mwm_WmError.h (new)        | 11 +++++++++++
 2 files changed, 22 insertions(+)
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2023-05-15 14:38:23 UTC
Fixed. Thanks for the patch.