Skip to content

build: add -Wall -Wextra to emcc and test gcc invocations#36

Merged
bushidocodes merged 5 commits into
masterfrom
chore/add-compiler-warning-flags
Jun 13, 2026
Merged

build: add -Wall -Wextra to emcc and test gcc invocations#36
bushidocodes merged 5 commits into
masterfrom
chore/add-compiler-warning-flags

Conversation

@bushidocodes

Copy link
Copy Markdown
Owner

Summary

  • Add -Wall and -Wextra to CCFLAGSBASE (used by all Emscripten/emcc builds).
  • Add TESTCFLAGS = -Wall -Wextra variable and wire it into all 5 test targets (test-sean, test-bfs, test-kruskal, test-strassen, test-malloc-guards), which previously called gcc with no warning flags at all.
  • Emscripten is Clang-based and fully supports both flags alongside the existing -s STRICT=1.

Test plan

  • CI passes
  • Any surfaced warnings are informational (no -Werror added)

🤖 Generated with Claude Code

bushidocodes and others added 5 commits June 12, 2026 20:58
Add TESTCFLAGS variable for test targets; add -Wall and -Wextra to
CCFLAGSBASE so all builds (emcc and gcc) surface diagnostics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds .github/workflows/ci.yml with two jobs:
- test: runs the gcc/Unity unit tests via 'make test' on every push/PR
- build: installs Emscripten and runs 'make build' to verify the WASM build

Also adds an aggregate 'test' Make target chaining the five existing
per-algorithm test targets, so CI (and local runs) need a single command.

This gives the warning-flag change real CI coverage: -Wall/-Wextra now
surface in build logs (e.g. an unused variable in bfs.c) without -Werror
breaking the build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Remove dead 'neighbor_count' declaration in bfs.c else-branch (only the
  if-branch copy was ever used; surfaced by -Wextra).
- Add -Werror to TESTCFLAGS and CCFLAGSBASE so warnings fail the build.
- Bump actions/checkout v4 -> v5 (v4 runs on deprecated Node 20).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drop unused argc/argv parameters (main takes void).
- Use size_t for the array-size loop index to fix -Wsign-compare.

Surfaced once -Werror was added to the emcc build flags.
@bushidocodes bushidocodes merged commit 59f290c into master Jun 13, 2026
2 checks passed
@bushidocodes bushidocodes deleted the chore/add-compiler-warning-flags branch June 13, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant