An added non-ASCII character case breaks compiled runs
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 75/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- c, cpp, java, javascript
- Domínio
- testing-qa, tooling
Direção de pesquisa
Comece com charLiteral em web/compiler-explorer.js e candidateTypeMatches em web/runners.js para rastrear como os casos de caracteres são gerados e aceitos. Encontre os testes que cobrem esses caminhos e adicione casos para é e um emoji. O trabalho estará concluído quando a adição de qualquer um dos dois caracteres não ASCII for recusada com uma mensagem que o nomeie e os testes passarem.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 228
- Forks
- 150
- Merge médio
- 1d 3h
- PRs com merge (30d)
- 226
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de sysprog21/codetrial
-
Spot Capacity Round Trips tests accept the two largest rising runsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Diagnostic category comment disagrees with its testsTalvez já em andamento @woohsin assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
sysprog21/codetrial#666 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Local recording ends at Finish, before the learning reviewTalvez já em andamento @richard81115 assumiu há 2 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
sysprog21/codetrial#663 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Task editor scroll-sync test fails intermittently in CITalvez já em andamento @melonpuff assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
sysprog21/codetrial#654 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
sysprog21/codetrial#646 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de sysprog21/codetrial
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
horizon-rust/horizon#16176 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
asonnino/blockchain-validator#88 ·
Mantenedores costumam responder em até 1 dia
-
BUG-MERGE-TO-HDR-RESULT-NAMETalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
storytold/photocraft#14025 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
-
ExtrudeAbertaarea:kernel bug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
bherbruck/solvecraft#16273 · 1 comentário · 1 reação ·