`DIR-4-15`: Add support for `fpclassify()` functions.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với triển khai DIR-4-15 hiện có và hạ tầng của thư viện guards được tham chiếu trong issue. So sánh ba mẫu guard của fpclassify, bao gồm các điều kiện trực tiếp, các nhánh switch và một biến phân loại được gán. Được xem là hoàn thành khi các chuyển đổi được guard và được hỗ trợ không còn tạo ra lỗi, trong khi các chuyển đổi có khả năng không an toàn không được guard vẫn tiếp tục được chẩn đoán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Affected rules
DIR-4-15\
Description
The first implementation of the rule handles guards of the form isinf, isnan, isfinite, iszero, etc., however, it doesn't support guards relating to fpclassify().
Example
float may_be_inf() {
...
return 1.0/0.0;
}
void fpclassify_guard() {
float x = may_be_inf();
int y;
// error, casting possible infinity to int
y = x;
// example 1: easiest to support:
if (fpclassify(x) != FP_INFINITE) {
// or "fpclassify(x) == FP_NORMAL"
y = x;
}
// example 2: perhaps slightly harder to support, but guards library already has infra for this:
switch(x) {
case FP_NORMAL:
case FP_SUBNORMAL:
case FP_ZERO:
// or, "case FP_INFINITE: break; default:"
y = x;
}
// example 3: this is harder to support but a common pattern:
int cls = fpclassify(x);
if (cls != FP_INFINITE) {
// or "cls == FP_NORMAL || cls == FP_ZERO"
y = x;
}
}
- Ngôn ngữ chính
- CodeQL
- Star
- 227
- Fork
- 82
- Merge trung bình
- 6 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 9
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 github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Đang mởfalse positive/false negative
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
github/codeql-coding-standards#1175 ·
Tất cả issue của github/codeql-coding-standards
Issue tương tự
-
wireguard-wp unbalanced "-RunAs" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ScoopInstaller/Nonportable#639 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ScoopInstaller/Extras#18800 ·
-
Actualizar al último Wollok Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
uqbar-project/website-wollok-ts#84 · 2 bình luận ·
-
on hold T: core-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100