Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Amalgamation compiles with warnings at -O0 (-Wreturn-type) and -O1 (-Wmaybe-uninitialized)

Abierto Apto para principiantes
#1,775 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@facelessdevhack ya está trabajando en esto.

Desde el 15/10/2026.

  • #1799 de @facelessdevhack — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c
Área
build-system

Línea de trabajo

Empieza con la compilación de amalgamación: ejecuta make amalgamation, luego compila build/eigenscript_all.c con gcc -Wall -Wextra -O0 -c y -O1 para reproducir las advertencias. La advertencia -Wreturn-type apunta a builtin_tensor_gather, que termina en ARG_GUARD(1, ...); añade un return explícito después del raise. Las advertencias -Wmaybe-uninitialized afectan a _ad/_bd en vm_run_ex y al índice i en vm_index_resolve; inicialízalos donde se declaran. Se da por terminado cuando ambas compilaciones no muestran líneas con warning: y make embed-smoke lo protege.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:embed bug found-by:code-review

Finding

The release build (make, -O2) is warning-free, but the shipped single-file amalgamation (make amalgamation, build/eigenscript_all.c, the "copy two files" embed path, #397) is not at the other usual optimisation levels. Measured on main 0740af03 with gcc -Wall -Wextra $(cat tools/werror_flags.txt) -c build/eigenscript_all.c:

  • -O0 (the usual embedder debug build): 1 warning, builtin_tensor_gather: control reaches end of non-void function [-Wreturn-type]. The function ends in ARG_GUARD(1, ...), whose constant condition -O0 does not fold.
  • -O1: 7 warnings, all -Wmaybe-uninitialized:
    • 5 x _ad, reached through num_to_i64_exact, inlined into vm_run_ex. The bitwise arms read _ad after slot_as_double(_as, &_ad) & slot_as_double(_bs, &_bd), which sets it only on success.
    • 2 x i, reached through vm_index_resolve, inlined into jit_helper_index_set.

All are false positives by inspection, but an embedder compiling eigenscript_all.c with -Wall at -O0 or -O1 gets them. Found while building #1758's C slot test against the amalgamation, which now compiles with the release flags to avoid them.

Done when

  • After make amalgamation, gcc -Wall -Wextra $(cat tools/werror_flags.txt) -O0 -c build/eigenscript_all.c and the same with -O1 print no warning: line (paste both counts in the PR).
  • builtin_tensor_gather ends in a statement the compiler can see returns at every level, for example the raise followed by an explicit return. _ad/_bd and the index i are initialised where they are declared.
  • A check keeps it that way. For example, make embed-smoke also compiles the amalgamation at -O0 -Wall -Wextra and greps the output for warning:. Planted fault: removing the return again turns it red.
Lenguaje dominante
C
Estrellas
3
Forks
7
Merge medio
8 h 43 min
PR fusionados (30 d)
253

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de InauguralSystems/EigenScript

Todos los issues de InauguralSystems/EigenScript

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.