[Bug 268232] devel/p5-IO-Tty: fix build with clang 15

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 07 Dec 2022 17:53:52 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268232

            Bug ID: 268232
           Summary: devel/p5-IO-Tty: fix build with clang 15
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: perl@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(perl@FreeBSD.org)
          Assignee: perl@FreeBSD.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.