Skip to content

COMP: Fail the build on an undeclared external function - #92

Open
hjmjohnson wants to merge 2 commits into
fix/buildyml-jobsfrom
ci/missing-declarations
Open

hjmjohnson wants to merge 2 commits into
fix/buildyml-jobsfrom
ci/missing-declarations

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Re-submission of #81, reverted from master on 2026-09-24 so it can be
reviewed before merging. Content is unchanged from the original.

Stack position 8 of 10. Base: fix/buildyml-jobs (#78), not master.
Merge the PRs above it in this stack first, or the diff shown here will
include their commits too.

Ordering for this stack

# PR branch base
1 #29 ci/install-linking-srcdir master
2 #28 ci/test-output-on-failure ci/install-linking-srcdir
3 #30 ci/guard-cmp0169 ci/test-output-on-failure
4 #75 ci/build-all-codepaths ci/guard-cmp0169
5 #77 ci/widen-coverage ci/build-all-codepaths
6 #37 pr/fix-missing-prototypes ci/widen-coverage
7 #78 fix/buildyml-jobs pr/fix-missing-prototypes
8 #81 <- this PR ci/missing-declarations fix/buildyml-jobs
9 #82 ci/windows ci/missing-declarations
10 #83 ci/workflow-trigger-lint ci/windows

The order is the order these changes sat on master before the revert, so
it 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.txt
and cifti/afni_xml.h. Cherry-picked onto master alone, the later ones
conflict. 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_linking to find its source directory.

Commits
  • COMP: Give the pigz writers internal linkage
  • COMP: Make an undeclared external function fail the build

See #84 for the ordering of all 49 re-submitted pull requests.

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 copy of doPigz2 in the NIFTI-1 library is byte-identical to doPigz
beside it and nothing calls it, so it is excluded from the build rather
than given linkage it does not need.

The exported symbol set is unchanged: this code compiles only under
PIGZ, which the shared build behind the baseline does not define.

(cherry picked from commit 1abbd85)
-Wmissing-declarations is already in the project's clean set, but a
warning in a build that passes anyway is not read, so two changes that
added declarations reached master with nothing to stop the next one.

Both FSLSTYLE settings are covered. The flag catches nifti_fileexists
on one side and axml_recur_find_xml, FslGetHdrImgNames and
FslSetIntensityScaling on the other, each of which reached master as a
warning nobody acted on.

(cherry picked from commit b4876bf)
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