Skip to content

Commit

Permalink
x11/xdm: 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 x11/xdm:

  greet.c:451:20: error: incompatible function pointer types assigning to 'void (*)(void)' from 'int (*)(void)' [-Wincompatible-function-pointer-types]
      __xdm_setgrent = dlfuncs->_setgrent;
		     ^ ~~~~~~~~~~~~~~~~~~

This is because it assumes setgrent(3) returns int, which it has not
done since a very long time.

Reported by:	O. Hartmann <ohartmann@walstatt.org>
PR:		272209
MFH:		2023Q2
  • Loading branch information
DimitryAndric committed Jun 28, 2023
1 parent bef45ef commit ffa7085
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions x11/xdm/Makefile
@@ -1,5 +1,6 @@
PORTNAME= xdm
PORTVERSION= 1.1.14
PORTREVISION= 1
CATEGORIES= x11

MAINTAINER= x11@FreeBSD.org
Expand Down
11 changes: 11 additions & 0 deletions x11/xdm/files/patch-include_greet.h
@@ -0,0 +1,11 @@
--- include/greet.h.orig 2022-12-03 21:38:28 UTC
+++ include/greet.h
@@ -45,7 +45,7 @@ from The Open Group.
# define GETPWNAM_ARGS /*unknown*/
#endif

-#if defined(__FreeBSD__) || defined(__bsdi__) || defined(__osf__)
+#if defined(__bsdi__) || defined(__osf__)
# define SETGRENT_TYPE int
#else
# define SETGRENT_TYPE void

0 comments on commit ffa7085

Please sign in to comment.