Skip to content

Commit d1e5b0e

Browse files
authored
JIT/AArch64: [macos] Remove Clang warning due to -Wincompatible-pointer-types (#7098)
The following warning message would be produced for macOS on Apple silicon. ``` php-src/ext/opcache/jit/zend_jit_arm64.dasc:15356:79: warning: incompatible pointer types passing 'ptrdiff_t *' (aka 'long *') to parameter of type 'int64_t *' (aka 'long long *') [-Wincompatible-pointer-types] const char *name = zend_jit_disasm_find_symbol((ptrdiff_t)cp + offset - 4, &offset); ^~~~~~~ ext/opcache/jit/zend_jit_disasm.c:210:58: note: passing argument to parameter 'offset' here int64_t *offset) { ^ ``` Flag -Wincompatible-pointer-types is enabled by default in Clang [1], but not in GCC [2]. Adding explicit type conversion would remove this warning. [1] https://releases.llvm.org/10.0.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-pointer-types [2] https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Warning-Options.html#Warning-Options Change-Id: Ia0777a5731ba8f0764e232c0d47aeaab076d13f5
1 parent b15a8e6 commit d1e5b0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14760,7 +14760,7 @@ static int zend_jit_add_veneer(dasm_State *Dst, void *buffer, uint32_t ins, int
1476014760

1476114761
#ifdef HAVE_DISASM
1476214762
if (JIT_G(debug) & ZEND_JIT_DEBUG_ASM) {
14763-
const char *name = zend_jit_disasm_find_symbol((ptrdiff_t)cp + offset - 4, &offset);
14763+
const char *name = zend_jit_disasm_find_symbol((ptrdiff_t)cp + offset - 4, (int64_t *)(&offset));
1476414764

1476514765
if (name && !offset) {
1476614766
if (strstr(name, "@veneer") == NULL) {

0 commit comments

Comments
 (0)