Repository navigation
COMP: Fail the build on an undeclared external function - #92
hjmjohnson wants to merge 2 commits into
Conversation
9114f7e to
766f888
Compare
5f432d3 to
d68c3ff
Compare
d68c3ff to
f1c76aa
Compare
|
Plain rebase onto |
| # The configuration a downstream project vendoring only the core | ||
| # reader selects. Nothing else in the matrix proves the tree still | ||
| # configures with the optional subdirectories switched off. |
There was a problem hiding this comment.
Maybe I need more coffee but I just don't grok these words...
| # Guards cmake_minimum_required. Every other runner carries a | ||
| # recent CMake, so a policy or command that needs a newer release | ||
| # than the project claims to support is invisible to them. | ||
| # PR #30 was exactly that: CMP0169 does not exist before 3.30 and |
There was a problem hiding this comment.
I wouldn't refer to PRs in the code comments, could be confusing vs upsteam vs the ITK fork.
gdevenyi
left a comment
There was a problem hiding this comment.
Review by Google Carbon
Verdict: Request Changes (Draft; blocked on #90 + #89)
Investigated all 3 failing CI checks and compiler behavior across GCC and Clang:
- Root causes of the 3 CI failures:
exported symbol baselinefails (cmake/collect_exported_symbols.sh: No such file or directory) because commitf1c76aabundled theminimal,oldest-cmake(still using Ubuntu's CMake 3.28 instead of#89's 3.10.2), andexported-symbolsYAML jobs withoutcmake/collect_exported_symbols.shorcmake/exported_symbols_linux.txt(which live in#89).no undeclared external functions (FSLSTYLE=OFF/ON)fails on the 14 undeclared external functions fixed in#90.
- Drop commit
9db2f11(doPigz) on rebase:#90(026c6cb) already incorporates thedoPigz/doPigz2fix and addresses@seanm's comment by deleting deaddoPigz2innifti1_io.cinstead of#if 0-ing it. Once#90and#89merge, rebasing#92should drop9db2f11and the duplicateminimal/oldest-cmake/exported-symbolshunks. -Werror=missing-declarationsis a no-op for C functions on Clang: In C11 mode, Clang ignores-Wmissing-declarationson functions (0warnings onmaster!) and requires-Wmissing-prototypes(which works identically on both GCC and Clang). Rather than adding 2 dedicated Ubuntu build jobs, consider promoting-Wmissing-prototypesintocmake/nifti_warnings.cmake's clean set once#90lands and passing-DCMAKE_C_FLAGS="-Werror=missing-prototypes -Werror=missing-declarations".- Please also address
@seanm's open wording comment on themissing-declarationsjob header.
| run: cmake --build ${{ github.workspace }}/build | ||
| - name: Collect exported symbols | ||
| run: | | ||
| bash cmake/collect_exported_symbols.sh \ |
There was a problem hiding this comment.
[Google Carbon] minimal (line 73), oldest-cmake (line 101), and exported-symbols (line 128) belong to PR #89 — and exported-symbols fails here because cmake/collect_exported_symbols.sh and cmake/exported_symbols_linux.txt are not on this branch. Please drop lines 73–166 when rebasing onto master after #89 lands.
doPigz and doPigz2 are called only from the file that defines them and appear in no header, so they are internal. Declaring them so is what lets -Wmissing-declarations be promoted to an error on the FSLSTYLE path, where they were the only offenders. The NIFTI-1 library also carried a doPigz2, taking a nifti_1_header despite its name, byte-identical to doPigz beside it and called from nowhere. It is removed. The exported symbol set of the default build is unchanged: this code compiles only under PIGZ, which FSLSTYLE enables.
-Wmissing-declarations is in the project's warning set but does not fail the build, so external functions with no declaration in a header have reached master. This job makes it fatal on both FSLSTYLE settings, each of which compiles functions the other does not. -Werror=missing-prototypes is passed too: for C, Clang checks undeclared functions only under that flag, while GCC checks both. The full NIFTI_WARNINGS_AS_ERRORS set is still blocked by -Wmaybe-uninitialized in fslio.c, so this one flag is promoted alone.
f1c76aa to
a1e97ca
Compare
Re-submission of #81, reverted from
masteron 2026-09-24 so it can bereviewed before merging. Content is unchanged from the original.
Base:
master. This PR adds two checks (-Werror=missing-declarationsand an exported-symbol baseline) that are expected to be red onmasteruntil #88, #89 and #90 merge. Run with GCC 16 against this branch, the strict build flagsaxml_recur_find_xmlinafni_xml.cand many functions infslio.c; on the tip of the full chain (#93) the same build is clean and all 344 tests pass. The exported-symbol job needscmake/collect_exported_symbols.sh, which comes from #88 and #89. Merge those first, then rebase this ontomaster.In git, this branch's two commits are the first two commits of the chain that ends at
ci/windows(#93).Ordering for this stack (as of 2026-11-03)
ci/install-linking-srcdirmasterci/test-output-on-failuremasterci/guard-cmp0169ci/test-output-on-failureci/build-all-codepathsmasterci/widen-coverageci/build-all-codepathspr/fix-missing-prototypesmasterfix/buildyml-jobsmasterci/missing-declarationsmasterci/windowsci/missing-declarationsci/workflow-trigger-lintci/windowsThe order is the order these changes sat on
masterbefore the revert, soit is known to build and test at every step. Verified again after
rebuilding the stack: the tip configures, compiles with no errors, and
passes 344/344 tests.
Why this one is stacked rather than independent
Each PR in this chain edits the same few files as its predecessors, chiefly
.github/workflows/cmake-multi-platform.yml,cmake/exported_symbols_linux.txtand
cifti/afni_xml.h. Cherry-picked ontomasteralone, the later onesconflict. Two members also carry a build-order dependency rather than a
textual one: without #30 the project does not configure at all on CMake
versions that do not know policy CMP0169, and #29 is needed for
install_linkingto find its source directory.Commits
See #84 for the ordering of all 49 re-submitted pull requests.