Date: Thu, 04 Jun 2020 10:30:42 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 246975] comms/scrcpy: fix build on GCC architectures Message-ID: <bug-246975-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246975 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@FreeBSD.org Reporter: pkubaj@FreeBSD.org Flags: maintainer-feedback?(tagattie@FreeBSD.org) Assignee: tagattie@FreeBSD.org Created attachment 215223 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D215223&action= =3Dedit patch When building on head (on powerpc64) with Clang the following warnings happ= en: ../app/src/sys/unix/command.c: In function 'cmd_search': ../app/src/sys/unix/command.c:31:12: warning: implicit declaration of funct= ion 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration] 31 | path =3D 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 =3D strdup(path); | ^ ../app/src/sys/unix/command.c:38:22: warning: implicit declaration of funct= ion 'strtok_r'; did you mean 'strtok'? [-Wimplicit-function-declaration] 38 | for (char *dir =3D strtok_r(path, ":", &saveptr); dir; | ^~~~~~~~ | strtok ../app/src/sys/unix/command.c:38:22: warning: initialization of 'char *' fr= om '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 =3D 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 =3D 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 funct= ion 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration] 31 | path =3D 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 =3D strdup(path); | ^ ../app/src/sys/unix/command.c:38:22: warning: implicit declaration of funct= ion 'strtok_r'; did you mean 'strtok'? [-Wimplicit-function-declaration] 38 | for (char *dir =3D strtok_r(path, ":", &saveptr); dir; | ^~~~~~~~ | strtok ../app/src/sys/unix/command.c:38:22: warning: initialization of 'char *' fr= om '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 =3D 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 =3D strtok_r(NULL, ":", &saveptr)) { | ^ Undefine _POSIX_SOURCE to fix it. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-246975-7788>