Created attachment 215223 [details] 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.
A commit references this bug: Author: tagattie Date: Sat Jun 6 09:31:30 UTC 2020 New revision: 538080 URL: https://svnweb.freebsd.org/changeset/ports/538080 Log: Fix build on GCC architectures PR: 246975 Submitted by: pkubaj Approved by: mentors (implicit) Changes: head/comms/scrcpy/files/ head/comms/scrcpy/files/patch-app_src_sys_unix_command.c
Committed, thanks!