Harness header hygiene: trailing semicolons, name collisions, argument capture

Aperta
#423 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, cpp, rust

Direzione di ricerca

Start by inspecting the listed harness/tsffs-*.h and harness/tsffs.h macro definitions, then check harness/test.sh:25-26 and the MSVC C++ branch. Compare tsffs-gcc-x86.h with tsffs-gcc-x86_64.h and the riscv32/riscv64 headers; verify the reported issues with focused compile cases, including if (x) HARNESS_STOP(); else ... and an argument named value. Done means the listed header and script issues are corrected and the harness checks pass.

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

Descrizione

Where

  • all harness/tsffs-*.h and harness/tsffs.h

Problem

  • All macro bodies end in } while (0);, breaking if (x) HARNESS_STOP(); else ....
  • x86 headers define __cpuid (collides with <cpuid.h>/<intrin.h>); arm headers define __stringify (collides with linux/stringify.h).
  • The local value in x86 macros captures a user argument named value: HARNESS_START_WITH_MAXIMUM_SIZE(buf, value) passes the magic number.
  • tsffs-gcc-x86.h duplicates tsffs-gcc-x86_64.h; riscv32/riscv64 differ only in whitespace.
  • harness/test.sh:25-26 missing / in rm paths; MSVC C++ branch uses size_t with only <cstdint>.

Impact
Compile errors or silent miscompiles in user harnesses.

Suggested fix
Drop the trailing ;, prefix internal helpers with __tsffs_, rename the macro local, dedupe identical headers.

Related
#394, #379 (arm32 index)

Status
Reported by static code review at 79972db; not yet re-verified line by line. Found by reading the code; not reproduced under SIMICS.

Lingua principale
Rust
Stelle
335
Fork
26
Merge medio
1g 50m
PR unite (30g)
12

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 intel/tsffs

Tutte le issue di intel/tsffs

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.