driver: suggest the closest warning for an unknown -W name
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Read the unknown warning handling in src/driver/main.c around lines 7625 and 7729, then inspect warning enumeration in src/driver/diag.c and edit_distance() in src/sema/sema.c. Start with tests/golden/driver-wp.sh to see the current output. Add close and distant typo cases; done means the three specified misspellings suggest unused-variable, distant names get no suggestion, and the tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context. A misspelled warning is reported, but EmbCC does not say what was probably meant:
$ ./embcc -Wunused-vairable -c t.c
embcc: warning: -Wunused-vairable is not a warning EmbCC has, so it turns nothing on (--help-warnings lists them)
It should add did you mean -Wunused-variable?.
Where.
src/driver/main.c, around line 7729, where a-Wor-Wno-name is looked up. Near line 7625 there is a second message of the same kind, for-Werror=NAME("names no warning EmbCC has"); give it the suggestion too.src/driver/diag.c, line 1068:diag_warning_count()anddiag_warning_name(i)list every warning name.src/sema/sema.c, line 2108:edit_distance(). It isstatic; share it with the driver instead of copying it. Another good first issue moves the same function, for--target=; whichever lands first, the other reuses it.- Tests:
tests/golden/driver-wp.shchecks the current message.
Steps.
- For an unknown name, find the closest
diag_warning_name(i). Suggest it only if it is withinmax(2, len / 3)edits. - Add the suggestion to the warning, keeping the existing wording, so scripts that grep for it still match.
- Add cases to the test: one with a close typo, and one with a name far from every warning.
Done when -Wunused-vairable, -Wno-unused-vairable and -Werror=unused-vairable all suggest unused-variable, a far-off name suggests nothing, and the tests pass.
Before you start: the contributor's guide has the rules. A new test counts only after it has failed against the code before your change, and a commit subject reads area: summary. Questions are welcome in the comments or in Discussions.
- Lenguaje dominante
- C
- Estrellas
- 1
- Forks
- 2
- Merge medio
- 20 h 55 min
- PR fusionados (30 d)
- 73
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de EmbLinkOs/EmbCC
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
Los mantenedores suelen responder en 1 día
Todos los issues de EmbLinkOs/EmbCC
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area: test kind: bug preview-effort: small priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
libsdl-org/SDL#16684 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Issue-Bug Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días