Check C++ starter node comments against the C++ harness
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Rust
- 星标
- 223
- 派生
- 148
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 224
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sysprog21/codetrial 的其他 Issue
-
Transcript tab does not scroll to new turns可能已有人在做 @henrylee1003 今天认领。 未关闭
sysprog21/codetrial#592 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Let candidates save and switch between named session setups可能已有人在做 @domin67 今天认领。 未关闭
sysprog21/codetrial#591 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Let the candidate choose the editor indentation width可能已有人在做 @princelu1009 今天认领。 未关闭
sysprog21/codetrial#589 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
sysprog21/codetrial#587 · 4 条评论 ·
维护者通常 1 天内回复
-
CODETRIAL_DURATION_MIN does not preselect the interview length in the lobby可能已有人在做 @RWong04 于 1 天前认领。 未关闭
sysprog21/codetrial#582 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 sysprog21/codetrial 的全部 Issue
相似的 Issue
-
bug cluster redis-compat
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
tangency-labs/solidcore#2839 ·
维护者通常 1 天内回复
-
bug priority: low ui
难度 2/5 1-3 小时 新手友好度 68/100
storytold/gridcraft#3446 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
madeofpendletonwool/PinePods#1078 ·
维护者通常 1 天内回复