fix(cl): handle plain char on unsigned-char targets
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
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- build-system, tooling
Línea de trabajo
Start with the C type mapping and macro argument generation implicated by the CXType_Char_U versus CXType_UChar distinction. Reproduce on Linux arm64 with the stated CI command, then compare generated output for cl/_testc/function and the cl/_testc/macrofn_auto/in.h fixture. Done means plain char bindings and forwarding macro string arguments generate successfully with behavior that respects target char signedness.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On Linux arm64, Clang reports plain C char as CXType_Char_U. llcppg currently maps Char_U and explicit unsigned char (CXType_UChar) together to Go uint8. This makes ordinary char * bindings incompatible with c.Str, which returns *c.Char.
Reproduction
On Linux arm64, run the existing CI command:
llgo test -v -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
The existing cl/_testc/macrofn_auto/in.h fixture contains this forwarding macro:
#define ZLIB_VERSION "1.3.1"
int deflateInit_(z_streamp strm, int level, const char *version, int stream_size);
#define z_deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
Actual behavior
The const char *version parameter is mapped to *uint8, but the automatically generated macro call passes c.Str("1.3.1"), whose type is *c.Char. Generation panics because *c.Char cannot be passed as *uint8.
The generated output also differs from the existing fixtures for ordinary char * declarations. For example, cl/_testc/function produces Xprintf(fmt *uint8, ...) while the expected output uses *c.Char.
Expected behavior
Plain char bindings and string arguments in forwarding macros should work on Linux arm64 without a generation panic. Handling should account for the distinction between plain char and explicit unsigned char, as well as the target's char signedness.
Environment and evidence
Reproduced on Ubuntu 24.04 arm64 with LLVM 22, LLGo 1.0.8, Go 1.27.0, and github.com/goplus/lib v0.7.1, based on main commit b36e6307e67751c67654da37297ab654ef0ef0e3. The Linux arm64 job added in #1149 reproduces the failure: https://github.com/goplus/llcppg/actions/runs/42154256948/job/127684520612
- Lenguaje dominante
- Go
- Estrellas
- 40
- Forks
- 13
- Merge medio
- 2 h 48 min
- PR fusionados (30 d)
- 109
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 goplus/llcppg
-
proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
goplus/llcppg#1136 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Proposal: Automatic Merging of Per-Platform PackagesPosiblemente ocupada @fennoai la tomó hace 4 días. AbiertoArchitecture-Design feature proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 39/100
goplus/llcppg#1129 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de goplus/llcppg
Issues similares
-
[Bug] Custom tool truncation leaves unused stream copies openPosiblemente ocupada @OUAO-FRANK la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyAbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
crmne/hyprmoncfg#114 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
runtime: usleep sleeps nanoseconds instead of microseconds on linux/mips and linux/mips64Posiblemente ocupada @BRobertson7 la tomó hoy. Abiertocompiler/runtime
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
golang/go#82913 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100