Commit d3b8f62
ci: fix red lint gates (deadcode mis-scope + vet unreachable/self-assign)
The tests pass; CI was red on two lint gates only.
deadcode (go.yml): the gate ran `deadcode ./example/webserver`, a single
entry point that does not import the engine's determinism machinery, so it
flagged seed.go's SeedRandom/SetDeterministicTics/ResetClock/CurrentTic/
RandomState as dead. They are NOT dead -- they are consumed by
cmd/harvest-reference and backend/tamago and exercised by seed_test.go. The
gate was simply pointed at too narrow an entry-point set. Widen it to the
real engine consumers (./cmd/harvest-reference, ./embedwad) and add -test so
deadcode builds the true reachability graph (this also covers embedwad's
build-tagged DOOM1WAD stub, reachable only from its own package test). The
cgo SDL/ebitengine demos stay excluded -- they don't build without SDL and
are covered by the "Build example" step.
go vet (ci-6arch.yml): the vet gate failed on 24 unreachable-code and 3
self-assignment findings in the mechanically transpiled doom.go, plus the
advisory unsafeptr findings inherent to the C-to-Go pointer port.
- Removed the 24 unreachable statements: dead `fallthrough` after a C
`break`/`return` (preserves C break semantics -- the fallthrough never
ran and would be wrong if it did), dead `goto LABEL` sitting immediately
before `LABEL:`, dead `break` after `return`, and trailing
`return`/`return 0` after an exhaustive terminating switch / if-else /
`for {}`. All are pure deletions of never-executed statements; control
flow is identical.
- Removed the 3 `x = x` self-assignments (skytexturename and the two
wadinfo byte-swap-macro artifacts that transpiled to identity on
little-endian); they are no-ops, behavior is unchanged.
- Disabled only the unsafeptr analyzer in the vet gate. doom.go threads
WAD I/O through (uintptr)(unsafe.Pointer(&buf)) -> w_Read(...), which
unsafeptr flags on every call. These are not real defects (the pointer
is consumed immediately, never stored across a call) and fixing them
would mean hand-editing the transpiled C port. Every other analyzer
stays on, so unreachable/self-assignment/printf regressions are still
caught.
No engine logic was changed beyond removing the precise vet-flagged dead
statements.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0f8703e commit d3b8f62
3 files changed
Lines changed: 20 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
45 | 54 | | |
46 | | - | |
| 55 | + | |
47 | 56 | | |
48 | 57 | | |
49 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4945 | 4945 | | |
4946 | 4946 | | |
4947 | 4947 | | |
4948 | | - | |
4949 | 4948 | | |
4950 | 4949 | | |
4951 | 4950 | | |
| |||
5847 | 5846 | | |
5848 | 5847 | | |
5849 | 5848 | | |
5850 | | - | |
5851 | 5849 | | |
5852 | 5850 | | |
5853 | 5851 | | |
| |||
7418 | 7416 | | |
7419 | 7417 | | |
7420 | 7418 | | |
7421 | | - | |
7422 | 7419 | | |
7423 | 7420 | | |
7424 | 7421 | | |
| |||
8517 | 8514 | | |
8518 | 8515 | | |
8519 | 8516 | | |
8520 | | - | |
8521 | 8517 | | |
8522 | 8518 | | |
8523 | 8519 | | |
| |||
22153 | 22149 | | |
22154 | 22150 | | |
22155 | 22151 | | |
22156 | | - | |
22157 | 22152 | | |
22158 | 22153 | | |
22159 | 22154 | | |
22160 | 22155 | | |
22161 | | - | |
22162 | 22156 | | |
22163 | 22157 | | |
22164 | 22158 | | |
| |||
23069 | 23063 | | |
23070 | 23064 | | |
23071 | 23065 | | |
23072 | | - | |
23073 | 23066 | | |
23074 | 23067 | | |
23075 | 23068 | | |
| |||
23950 | 23943 | | |
23951 | 23944 | | |
23952 | 23945 | | |
23953 | | - | |
23954 | 23946 | | |
23955 | 23947 | | |
23956 | 23948 | | |
| |||
23991 | 23983 | | |
23992 | 23984 | | |
23993 | 23985 | | |
23994 | | - | |
23995 | 23986 | | |
23996 | 23987 | | |
23997 | 23988 | | |
| |||
24047 | 24038 | | |
24048 | 24039 | | |
24049 | 24040 | | |
24050 | | - | |
24051 | 24041 | | |
24052 | 24042 | | |
24053 | 24043 | | |
| |||
24064 | 24054 | | |
24065 | 24055 | | |
24066 | 24056 | | |
24067 | | - | |
24068 | 24057 | | |
24069 | 24058 | | |
24070 | 24059 | | |
| |||
24106 | 24095 | | |
24107 | 24096 | | |
24108 | 24097 | | |
24109 | | - | |
24110 | 24098 | | |
24111 | 24099 | | |
24112 | 24100 | | |
| |||
24166 | 24154 | | |
24167 | 24155 | | |
24168 | 24156 | | |
24169 | | - | |
24170 | 24157 | | |
24171 | 24158 | | |
24172 | 24159 | | |
| |||
25174 | 25161 | | |
25175 | 25162 | | |
25176 | 25163 | | |
25177 | | - | |
25178 | 25164 | | |
25179 | 25165 | | |
25180 | 25166 | | |
| |||
25387 | 25373 | | |
25388 | 25374 | | |
25389 | 25375 | | |
25390 | | - | |
25391 | 25376 | | |
25392 | 25377 | | |
25393 | 25378 | | |
| |||
30869 | 30854 | | |
30870 | 30855 | | |
30871 | 30856 | | |
30872 | | - | |
30873 | 30857 | | |
30874 | 30858 | | |
30875 | 30859 | | |
| |||
31677 | 31661 | | |
31678 | 31662 | | |
31679 | 31663 | | |
31680 | | - | |
31681 | 31664 | | |
31682 | 31665 | | |
31683 | 31666 | | |
| |||
31696 | 31679 | | |
31697 | 31680 | | |
31698 | 31681 | | |
31699 | | - | |
31700 | 31682 | | |
31701 | 31683 | | |
31702 | 31684 | | |
| |||
31728 | 31710 | | |
31729 | 31711 | | |
31730 | 31712 | | |
31731 | | - | |
31732 | 31713 | | |
31733 | 31714 | | |
31734 | 31715 | | |
| |||
31870 | 31851 | | |
31871 | 31852 | | |
31872 | 31853 | | |
31873 | | - | |
31874 | 31854 | | |
31875 | 31855 | | |
31876 | 31856 | | |
| |||
32679 | 32659 | | |
32680 | 32660 | | |
32681 | 32661 | | |
32682 | | - | |
32683 | 32662 | | |
32684 | 32663 | | |
32685 | 32664 | | |
| |||
34291 | 34270 | | |
34292 | 34271 | | |
34293 | 34272 | | |
34294 | | - | |
34295 | 34273 | | |
34296 | 34274 | | |
34297 | 34275 | | |
| |||
40931 | 40909 | | |
40932 | 40910 | | |
40933 | 40911 | | |
40934 | | - | |
40935 | | - | |
40936 | 40912 | | |
40937 | 40913 | | |
40938 | 40914 | | |
| |||
0 commit comments