Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#1,775 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@facelessdevhack ci sta già lavorando.

Dal 15/10/2026.

  • #1799 di @facelessdevhack — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c
Ambito
build-system

Direzione di ricerca

Inizia con la build di amalgamation: esegui make amalgamation, poi compila build/eigenscript_all.c con gcc -Wall -Wextra -O0 -c e -O1 per riprodurre gli avvisi. L'avviso -Wreturn-type punta a builtin_tensor_gather, che termina con ARG_GUARD(1, ...); aggiungi un return esplicito dopo il raise. Gli avvisi -Wmaybe-uninitialized riguardano _ad/_bd in vm_run_ex e l'indice i in vm_index_resolve; inizializzali nel punto in cui sono dichiarati. È completato quando entrambe le build non stampano righe warning: e make embed-smoke lo verifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C
Stelle
3
Fork
7
Merge medio
8h 43m
PR unite (30g)
253

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di InauguralSystems/EigenScript

Tutte le issue di InauguralSystems/EigenScript

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.