POSIX::strtod returns an unparsed suffix instead of its offset
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Tìm phần triển khai Perl thuần của POSIX::strtod và các bài kiểm thử do dự án quản lý; issue không nêu đường dẫn của chúng. Trước tiên, hãy so sánh giá trị trả về thứ hai với system Perl đối với các đầu vào được phân tích hoàn toàn và một phần, bao gồm '-'. Bổ sung các bài kiểm thử tập trung và xác nhận cả hai backend PerlOnJava trả về số ký tự chưa được phân tích; khi đó bài kiểm thử Test-C2FIT-0.08 sẽ vượt qua mà không có cảnh báo ép kiểu số.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
PerlOnJava's pure-Perl POSIX::strtod implementation returns the unparsed suffix as its second value, while system Perl's POSIX::strtod returns the number of unparsed characters. This breaks callers that use the second value as an offset.
Reproduction
use POSIX qw(strtod);
my ($number, $unparsed) = strtod('-');
print "number=$number unparsed=$unparsed\n";
System Perl returns number=0 unparsed=1. PerlOnJava returns number=0 unparsed=- on both the JVM and interpreter backends.
The behavior causes a real CPAN test failure in Test-C2FIT-0.08, test Test::C2FIT::test::TypeAdapterTest::test_isnumber. Its _getnum helper rejects input when $unparsed != 0. With PerlOnJava, strtod('-') supplies '-'; numeric coercion turns that suffix into zero (and emits a numeric warning), so '-' is incorrectly accepted as a number. System Perl rejects it as expected.
Evidence
- CPAN random tester run
20261116-130945-12232, targetFilteredData(distributionTest-C2FIT-0.08): 73/74 subtests passed; onlyt/all_tests.t, test 10, failed. - The complete focused upstream suite passes under system Perl with the same selected
Test::Unitdependency version (0.30). - The focused test fails on both PerlOnJava backends with
'-' should not be a number!. - This is a pure-Perl distribution failure; XS reverse-dependency counts are not applicable.
Expected behavior
Match Perl's POSIX::strtod return contract: the second return value is the count of unparsed characters, rather than the unparsed suffix. The focused CPAN test should pass on both backends without numeric-coercion warnings from this check.
Validation suggestion
Add focused project-owned coverage for the second return value on fully parsed and partially parsed inputs, including '-', then validate the behavior on system Perl and both PerlOnJava backends. Re-run the Test-C2FIT-0.08 upstream suite as integration coverage.
- Ngôn ngữ chính
- Perl
- Star
- 67
- Fork
- 8
- Merge trung bình
- 5 giờ 12 phút
- Pull request đã merge (30 ngày)
- 131
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của fglock/PerlOnJava
-
area:cpan-port bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
fglock/PerlOnJava#2153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:parser bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
fglock/PerlOnJava#2137 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:runtime documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
fglock/PerlOnJava#2157 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:parser area:runtime bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
fglock/PerlOnJava#2156 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksĐang mởteam-cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
inverse-inc/packetfence#9728 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(char-create): show the real reason a character is refusedCó thể đã có người làm @baphomello đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày