Running Zend/zend_vm_gen.php on 32-bit system produces deprecation warnings
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.2k
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 103
Mô tả
Description
The following code:
./buildconf
./configure --disable-all
make
Emits some warnings when executing the Zend/zend_vm_gen.php script during the build (this is output for PHP 8.4, but also 8.3 and 8.2 produces similar warnings):
Deprecated: Implicit conversion from float 2147483648 to int loses precision in /home/petk/projects/php-src/Zend/zend_vm_gen.php on line 2476
Deprecated: Implicit conversion from float 2147483648 to int loses precision in /home/petk/projects/php-src/Zend/zend_vm_gen.php on line 2537
...
This removes the warnings, but as this script is 3k lines long all-in-one PHP file, I think it's better someone looks at this if this is correct.
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 7f503e78e2..473a774734 100755
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -2473,7 +2473,7 @@ function gen_vm($def, $skel) {
$opcodes[$code]["flags"] |= $vm_op_flags["ZEND_VM_NO_CONST_CONST"];
}
if (isset($opcodes[$code]["spec"]["COMMUTATIVE"])) {
- $opcodes[$code]["flags"] |= $vm_op_flags["ZEND_VM_COMMUTATIVE"];
+ $opcodes[$code]["flags"] |= (int) $vm_op_flags["ZEND_VM_COMMUTATIVE"];
}
}
$opnames[$op] = $code;
@@ -2534,7 +2534,7 @@ function gen_vm($def, $skel) {
$opcodes[$code]["flags"] |= $vm_op_flags["ZEND_VM_NO_CONST_CONST"];
}
if (isset($opcodes[$code]["spec"]["COMMUTATIVE"])) {
- $opcodes[$code]["flags"] |= $vm_op_flags["ZEND_VM_COMMUTATIVE"];
+ $opcodes[$code]["flags"] |= (int)$vm_op_flags["ZEND_VM_COMMUTATIVE"];
}
}
$opnames[$op] = $code;
PHP Version
PHP 8.2
Operating System
32-bit *nix (for example Debian or FreeBSD)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện cảnh báo bằng ./buildconf, ./configure --disable-all và make trên hệ thống 32-bit. Kiểm tra Zend/zend_vm_gen.php quanh dòng 2476 và 2537, sau đó xác minh rằng quá trình tạo VM hoàn tất mà không có cảnh báo deprecation và build được tạo vẫn hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- php
- Lĩnh vực
- build-system, compilers
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100