Check C++ starter node comments against the C++ harness
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 223
- Fork
- 148
- Merge medio
- 1g 11h
- PR unite (30g)
- 224
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/codetrial
-
Transcript tab does not scroll to new turnsForse già presa @henrylee1003 l’ha presa oggi. Aperta
sysprog21/codetrial#592 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Let candidates save and switch between named session setupsForse già presa @domin67 l’ha presa 1 giorno fa. Aperta
sysprog21/codetrial#591 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Let the candidate choose the editor indentation widthForse già presa @princelu1009 l’ha presa 1 giorno fa. Aperta
sysprog21/codetrial#589 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
sysprog21/codetrial#587 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CODETRIAL_DURATION_MIN does not preselect the interview length in the lobbyForse già presa @RWong04 l’ha presa 2 giorni fa. Aperta
sysprog21/codetrial#582 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sysprog21/codetrial
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
🐞 bug 🧩 bevy_gantz_egui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nannou-org/gantz#500 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Fedora 45 repoApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
metasequoiaime/msime#10989 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fritzprix/libr-agent#2612 ·
I maintainer di solito rispondono entro 1 giorno
-
find: -printf %h drops a doubled slashForse già presa @qodelicious l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno