build: add -Wall -Wextra to emcc and test gcc invocations#36
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-Walland-WextratoCCFLAGSBASE(used by all Emscripten/emcc builds).TESTCFLAGS = -Wall -Wextravariable and wire it into all 5 test targets (test-sean,test-bfs,test-kruskal,test-strassen,test-malloc-guards), which previously calledgccwith no warning flags at all.-s STRICT=1.Test plan
-Werroradded)🤖 Generated with Claude Code