[Bug 246975] comms/scrcpy: fix build on GCC architectures

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jun 4 10:30:43 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246975

            Bug ID: 246975
           Summary: comms/scrcpy: fix build on GCC architectures
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tagattie at FreeBSD.org
          Reporter: pkubaj at FreeBSD.org
             Flags: maintainer-feedback?(tagattie at FreeBSD.org)
          Assignee: tagattie at FreeBSD.org

Created attachment 215223
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=215223&action=edit
patch

When building on head (on powerpc64) with Clang the following warnings happen:
../app/src/sys/unix/command.c: In function 'cmd_search':
../app/src/sys/unix/command.c:31:12: warning: implicit declaration of function
'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
   31 |     path = strdup(path);
      |            ^~~~~~
      |            strcmp
../app/src/sys/unix/command.c:31:10: warning: assignment to 'char *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
   31 |     path = strdup(path);
      |          ^
../app/src/sys/unix/command.c:38:22: warning: implicit declaration of function
'strtok_r'; did you mean 'strtok'? [-Wimplicit-function-declaration]
   38 |     for (char *dir = strtok_r(path, ":", &saveptr); dir;
      |                      ^~~~~~~~
      |                      strtok
../app/src/sys/unix/command.c:38:22: warning: initialization of 'char *' from
'int' makes pointer from integer without a cast [-Wint-conversion]
../app/src/sys/unix/command.c:38:5: error: declaration of non-variable
'strtok_r' in 'for' loop initial declaration
   38 |     for (char *dir = strtok_r(path, ":", &saveptr); dir;
      |     ^~~
../app/src/sys/unix/command.c:39:17: warning: assignment to 'char *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
   39 |             dir = strtok_r(NULL, ":", &saveptr)) {
      |                 ^

Incidentally, they are fatal when building with GCC (on 12.1, powerpc64):
../app/src/sys/unix/command.c: In function 'cmd_search':
../app/src/sys/unix/command.c:31:12: warning: implicit declaration of function
'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
   31 |     path = strdup(path);
      |            ^~~~~~
      |            strcmp
../app/src/sys/unix/command.c:31:10: warning: assignment to 'char *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
   31 |     path = strdup(path);
      |          ^
../app/src/sys/unix/command.c:38:22: warning: implicit declaration of function
'strtok_r'; did you mean 'strtok'? [-Wimplicit-function-declaration]
   38 |     for (char *dir = strtok_r(path, ":", &saveptr); dir;
      |                      ^~~~~~~~
      |                      strtok
../app/src/sys/unix/command.c:38:22: warning: initialization of 'char *' from
'int' makes pointer from integer without a cast [-Wint-conversion]
../app/src/sys/unix/command.c:38:5: error: declaration of non-variable
'strtok_r' in 'for' loop initial declaration
   38 |     for (char *dir = strtok_r(path, ":", &saveptr); dir;
      |     ^~~
../app/src/sys/unix/command.c:39:17: warning: assignment to 'char *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
   39 |             dir = strtok_r(NULL, ":", &saveptr)) {
      |                 ^

Undefine _POSIX_SOURCE to fix it.

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


More information about the freebsd-ports-bugs mailing list