Check C++ starter node comments against the C++ harness
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Follow-up to #344/#345, which tie the C starters' struct Node comment to the C harness. The C++ starters document ListNode, TreeNode and Node in a comment as well, while web/compiler-explorer.js declares the classes the code actually compiles against, and nothing compares the two copies, so a member renamed, a constructor dropped, or an initializer lost in one copy goes unnoticed.
One such drift is already on main. Three C++ starters (fraud-rule-worst-case, right-to-left-layout, staging-drift-check) document TreeNode(int x) : val(x), left(nullptr) {}, which leaves right indeterminate, while the harness constructor sets both children to nullptr. A candidate who reads the comment as the contract has to assume a leaf built with one argument carries a garbage right pointer, which is not what the code runs against.
A test in tests/browser/compiler-explorer.test.js could read the C++ harness's ListNode, TreeNode and Node declarations and, for every C++ starter that documents one of them, check that:
- every documented member is declared by the harness with the same type;
- every documented constructor has a harness constructor accepting the same parameter types;
- every pointer member the matching harness constructor sets to null, the documented constructor initializes too.
Failures would name the page, the class and the member or constructor. I checked this by hand against the 36 starters (21 TreeNode, 11 ListNode, 4 Node): members and constructor signatures all agree today, and the initializer check reports right for the three pages above. Fixing their entries in problem-bank/problems.json and regenerating the pages makes it pass.
I would like to work on this.
- Ngôn ngữ chính
- Rust
- Star
- 223
- Fork
- 148
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 227
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 sysprog21/codetrial
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sysprog21/codetrial#604 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Compare code semantically across a force push in review bundlesCó thể đã có người làm @Alan52254 đã nhận hôm nay. Đang mở
sysprog21/codetrial#606 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Calculator % disagrees with // on negative operandsCó thể đã có người làm @YunJ-Chang đã nhận hôm nay. Đang mở
sysprog21/codetrial#602 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Start does nothing visible in the lobby when site data is blockedCó thể đã có người làm @sidney-Hung đã nhận hôm nay. Đang mở
sysprog21/codetrial#600 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a Copy results action to the coding test panelCó thể đã có người làm @seallllllllll đã nhận hôm nay. Đang mở
sysprog21/codetrial#598 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sysprog21/codetrial
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
ScoopInstaller/Extras#19275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:plugins kind:bug priority:p2 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/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 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: medium ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
storytold/gridcraft#3496 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bip39: Mnemonic::new_from_phrase rejects phrases with extra or non-space whitespaceCó thể đã có người làm @chukwudiikeh đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày