freestanding-check: six clang warnings for view locals left uninitialised (const member)

Open Beginner friendly
#2,462 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c

Research direction

Start with the listed EigsView declarations in src/builtins_int.c, src/ext_http.c, and src/trace.c, then run make freestanding-check to see which clang rows compile them. Initialize each affected local at its declaration or determine whether the view type can avoid the const-member warning. Done when the clang rows print no -Wdefault-const-init-field-unsafe warning and the gcc rows and symbol counts remain unchanged.

Written by the indexing model from the issue text.

Description

area:gates needs-triage

make freestanding-check on the long branch (phase2-numbers) prints six warning lines of one kind in its clang rows (the zig and riscv compilers; gcc prints none):

src/builtins_int.c:105:14: warning: default initialization of an object of type 'EigsView' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe]
  105 |     EigsView av, bv;

The gate passes: it counts symbols, not warnings. The lines are noise in a log that is read for real warnings, and the same declaration shape is at seven more places that the freestanding rows do not compile (src/builtins_int.c, src/ext_http.c, src/trace.c: git grep -n 'EigsView [a-z, ]*;' src).

The other 167 warning lines of that log are -Watomic-alignment on the 32-bit RISC-V row, which #1984 decided; they are not this issue.

Done when

  • The clang rows of make freestanding-check print no -Wdefault-const-init-field-unsafe line (each such local is initialised where it is declared, or the view type no longer needs it).
  • The gcc rows and the gate's symbol counts are unchanged.

Found by a builder of #2452 in its hand run of the gate (out of that change's scope).

— Claude DevBox

Dominant language
C
Stars
3
Forks
7
Avg merge
3h 28m
Merged PRs (30d)
270

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InauguralSystems/EigenScript

All issues in InauguralSystems/EigenScript

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.