An added non-ASCII character case breaks compiled runs
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, cpp, java, javascript
- Ambito
- testing-qa, tooling
Direzione di ricerca
Inizia con charLiteral in web/compiler-explorer.js e candidateTypeMatches in web/runners.js per ricostruire come vengono generati e accettati i casi di caratteri. Trova i test che coprono questi percorsi e aggiungi casi per é e un emoji. Il lavoro è completato quando l’aggiunta di uno dei due caratteri non ASCII viene rifiutata con un messaggio che lo nomina e i test passano.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Observed behavior
An added character case whose cell is a non-ASCII character, such as é or an emoji, is written raw between quotes by charLiteral. C and C++ never hand it over as typed, and Java does only within the Basic Multilingual Plane:
- C is built with clang on Compiler Explorer, and clang 21 (
-std=c17) refuses the literal, so the run reports a compile failure. - C++ is built with gcc there, and g++ 15 (
-std=c++20) reads'é'as a multi-character constant, warns, and the solution receives -87 instead of the character. A correct solution can fail the case silently. - Java runs on JDK 25 there, and javac 25 receives
écorrectly (233) but refuses an emoji ("character literal contains more than one UTF-16 code unit"). gino1203 reported an earlier javac that accepts it and passes only the high surrogate, 55357.
Python and JavaScript are not affected.
Expected behavior
A character case either reaches every compiled language as typed or is refused when the case is added, with a message that names the character, as an integer outside 32 bits already is.
Reproduction
At main after #683, with the checkout's web/compiler-explorer.js:
const { nativeLiteral } = await import("./web/compiler-explorer.js");
nativeLiteral("é", "character", "cpp"); // "'é'", raw UTF-8 between quotes
Compiling char c = <that literal>; printf("%d", c); gives -87 with g++ 15 and refuses to compile with clang++ 21; the same in C. Checked locally with gcc 15, clang 21 and Java 25.
Initial analysis
- Path:
charLiteralinweb/compiler-explorer.jsescapes quotes, backslashes and, after #683, U+0000 to U+001F; every other character is written as is. - Reach:
candidateTypeMatchesinweb/runners.jsaccepts any single code point as acharacter. - Domain: the six
characterjudges (copper-pad-continuity,letter-grid-tracer,letter-panel-tracing,puzzle-grid-save-check,rooftop-panel-footprint,sealed-air-pocket-backfill) take letters, digits,.,0or1, all ASCII. A C or C++charcannot hold a character outside ASCII as one value, so refusing a non-ASCIIcharacterwhen the case is added is simpler than encoding it.
Action items
- Refuse a non-ASCII
charactercase when it is added, naming the character. - Add a test that fails on
mainforéand an emoji.
Raised by gino1203 in a review of #683.
- Lingua principale
- Rust
- Stelle
- 228
- Fork
- 150
- Merge medio
- 1g 3h
- PR unite (30g)
- 226
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
-
Spot Capacity Round Trips tests accept the two largest rising runsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Diagnostic category comment disagrees with its testsForse già presa @woohsin l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
sysprog21/codetrial#666 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Local recording ends at Finish, before the learning reviewForse già presa @richard81115 l’ha presa 2 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
sysprog21/codetrial#663 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Task editor scroll-sync test fails intermittently in CIForse già presa @melonpuff l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sysprog21/codetrial#654 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
sysprog21/codetrial#646 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sysprog21/codetrial
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
asonnino/blockchain-validator#88 ·
I maintainer di solito rispondono entro 1 giorno
-
BUG-MERGE-TO-HDR-RESULT-NAMEApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
storytold/photocraft#14025 ·
I maintainer di solito rispondono entro 1 giorno
-
ExtrudeApertaarea:kernel bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bherbruck/solvecraft#16273 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
storytold/vectorcraft#7242 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno