Skip to content

ci: Gate the compiler warnings the glue answers for, in rcc and in each - #3004

Merged
krlmlr merged 1 commit into
mainfrom
claude/compiler-warnings-stance
Oct 19, 2026
Merged

krlmlr merged 1 commit into
mainfrom
claude/compiler-warnings-stance

Conversation

@krlmlr

@krlmlr krlmlr commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

This PR was prepared with Claude Code (an LLM), as the template asks to disclose.

Stance. The glue (everything in src/ outside src/vendor/, including the Stimulus-generated src/rinterface.c and src/cpp11.cpp) must compile without warnings under -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-cast-function-type. Warnings in the vendored igraph C library are counted but never fail anything. They get fixed upstream and arrive through the series. A warning is attributed to the file it points at, so a glue file is not blamed for what an igraph header says. This follows the model duckdb-r adopted in duckdb/duckdb-r#2620 and refined in duckdb/duckdb-r#2652, minus the vendored-scope enforcement, because rigraph has no patch stack for warning fixes. The reasons for each flag are in the new handbook/build/warnings/README.md.

What changes.

  • scripts/warnings.sh compiles just the ten glue objects (about 6 s with ccache) with the gate's flags and fails on a glue warning. scripts/warnings.sh vendored compiles the rest and only reports. The flags reach that one compile through a makefile of its own, never src/Makevars (CRAN rejects -Wno-* there) or ~/.R/Makevars, which R CMD check would also read. duckdb-r turned its check red that way before jarl #2652.
  • rcc: a new step in custom/after-install runs it in the smoke test only.
  • each: a new warnings gate in scripts/rcc-one.sh, between clean and check, with a 600 s stage budget. It applies only to commits that carry this change. A vendored commit that brings a new warning inside src/vendor/ stays green. One that makes the glue warn gets an R-side repair like any other breakage.
  • Stimulus (tools/py-stimulus): an optional input passed by value is now zero-initialized, and an output without a C counterpart no longer gets an unused SEXP. src/rinterface.c is regenerated, with a 13-line diff. This subrepo fix belongs upstream in igraph/stimulus as well.
  • Handbook: the new leaf handbook/build/warnings/, linked from build/ and from the root. The docs-consistency check is clean.

Warnings today (GCC 13.3, full build).

  • Glue: 7, all in the generated src/rinterface.c: five -Wmaybe-uninitialized on optional arguments and two -Wunused-variable in R_igraph_is_bipartite_coloring. This PR fixes them in the generator. The three ISO C function/object pointer conversions in src/rinterface_extra.c are left out of the report, the same exemption R CMD check makes. igraph keeps an R closure behind igraph_function_pointer_t, so the glue cannot avoid them.
  • Vendored: 40 C/C++ warnings (15 -Wsign-compare, 13 -Wmaybe-uninitialized, 5 -Wunused-value from the flex lexers, plus a few others) and 144 Fortran warnings in ARPACK.
  • None of these is one of R CMD check's "significant warnings", so CRAN's -Wall -pedantic run is clean on that count today. The existing check step already fails on such a WARNING wherever it occurs, vendored code included.

Verification. Locally, the glue gate fails on main's rinterface.c (it lists the seven warnings) and passes on this branch. EACH_GATES=warnings scripts/rcc-one.sh passes, as does scripts/each-shard-test.sh (20/20). CI's GCC 15 might find warnings that 13 does not, and this PR's own CI run is the first check of that.

  • By submitting this pull request, I assign the copyright of my contribution to The igraph development team.

Generated by Claude Code

…`each`

`scripts/warnings.sh` compiles the glue in `src/` with `-Wall -Wextra -pedantic`,
less `-Wunused-parameter` and `-Wcast-function-type`,
and fails on a warning in a file outside `src/vendor/`;
what the vendored igraph C library says is counted, never enforced.
The flags reach that one compile through a makefile of its own,
never `src/Makevars` or `~/.R/Makevars`.

The `rcc` smoke test runs it from `custom/after-install`,
and `scripts/rcc-one.sh` runs it as the new `warnings` gate on every series commit.

The seven warnings the glue raised today were all in the generated `src/rinterface.c`,
so they are fixed in Stimulus:
an optional input passed by value is now zero-initialized,
and an output without a C counterpart no longer gets an unused `SEXP`.

handbook/build/warnings/ states the stance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYsZPyv45TEMPAuop9eWMQ
@krlmlr
krlmlr merged commit a94d78b into main Oct 19, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/compiler-warnings-stance branch October 19, 2026 20:24
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.

2 participants