aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-12-07 17:46:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-12-18 17:24:57 +0000
commit0f85c4d7e4ceb4237ff6562a6b97c7051db01bf0 (patch)
tree668b1037ba7a43625d87ebebfe0b3fcf6a83de09
parentd7146f6d335b360c5c9fb736cf49c7af939b77d7 (diff)
downloadports-0f85c4d7e4ceb4237ff6562a6b97c7051db01bf0.tar.gz
ports-0f85c4d7e4ceb4237ff6562a6b97c7051db01bf0.zip
devel/p5-IO-Tty: fix build with clang 15
During an exp-run for llvm 15 (see bug 265425), it turned out that devel/p5-IO-Tty failed to build with clang 15: Tty.xs:190:1: error: static declaration of 'strlcpy' follows non-static declaration strlcpy(dst, src, siz) ^ /usr/include/string.h:99:9: note: previous declaration is here size_t strlcpy(char * __restrict, const char * __restrict, size_t); ^ This is because strlcpy() and various other functions are not correctly detected at configure time: Looking for _getpty()...... not found. Looking for getpt()........ not found. Looking for grantpt()...... not found. Looking for openpty()...... not found. Looking for posix_openpt(). not found. Looking for ptsname()...... not found. Looking for ptsname_r().... not found. Looking for sigaction().... not found. Looking for strlcpy()...... not found. Looking for ttyname()...... not found. Looking for unlockpt()..... not found. Looking for libutil.h...... FOUND. Looking for pty.h.......... not found. Looking for sys/pty.h...... not found. Looking for sys/ptyio.h.... not found. Looking for sys/stropts.h.. not found. Looking for termio.h....... not found. Looking for termios.h...... FOUND. Looking for util.h......... not found. Makefile.PL contains a C fragment that is used for this detection, but it assigns the incorrect type to the value returned from the tested function. This leads to compilation errors, even if the tested function *is* available. Fix this by using the correct type for the variable containing the return value. PR: 268232 Approved by: portmgr (tcberner) MFH: 2022Q4
-rw-r--r--devel/p5-IO-Tty/files/patch-Makefile.PL11
1 files changed, 11 insertions, 0 deletions
diff --git a/devel/p5-IO-Tty/files/patch-Makefile.PL b/devel/p5-IO-Tty/files/patch-Makefile.PL
new file mode 100644
index 000000000000..a8901338a67e
--- /dev/null
+++ b/devel/p5-IO-Tty/files/patch-Makefile.PL
@@ -0,0 +1,11 @@
+--- Makefile.PL.orig 2021-01-22 08:02:35 UTC
++++ Makefile.PL
+@@ -146,7 +146,7 @@ char $f ();
+ /* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+ char $f ();
+-char (*f) ();
++char f;
+
+ #ifdef F77_DUMMY_MAIN
+ # ifdef __cplusplus