Conversation
This was referenced Aug 15, 2026
This was referenced Aug 15, 2026
gdevenyi
marked this pull request as ready for review
August 15, 2026 05:27
hjmjohnson
force-pushed
the
pr/c11-standard
branch
2 times, most recently
from
September 22, 2026 02:11
57600c8 to
9cb00f5
Compare
hjmjohnson
force-pushed
the
pr/c11-standard
branch
from
September 22, 2026 10:48
9cb00f5 to
1a4981a
Compare
hjmjohnson
force-pushed
the
pr/c11-standard
branch
from
September 22, 2026 13:50
1a4981a to
82379c9
Compare
Member
|
Rebased onto current Built and tested in two configurations, because the
Both on macOS/AppleClang, where What changed in this update
|
seanm
reviewed
Sep 22, 2026
hjmjohnson
force-pushed
the
pr/c11-standard
branch
from
September 22, 2026 15:53
82379c9 to
c75d5cd
Compare
seanm
requested changes
Sep 22, 2026
hjmjohnson
force-pushed
the
pr/c11-standard
branch
2 times, most recently
from
September 23, 2026 11:20
c8ae7ee to
49b48b4
Compare
hjmjohnson
marked this pull request as draft
September 23, 2026 12:06
seanm
approved these changes
Sep 23, 2026
The build never set a C standard, so it used the compiler default. Set
CMAKE_C_STANDARD 11 with C_EXTENSIONS OFF.
Two POSIX dependencies were being satisfied silently by the gnu default
and now have to be requested:
cifti/afni_xml.c strdup(), 3 uses. Without a declaration this was
an implicit function declaration returning int
assigned to char * -- an error in C99 onward.
nifti1_io.c, popen()/pclose() in the optional PIGZ write path,
nifti2_io.c only compiled with -DFSLSTYLE_PIGZ_SUPPORT=ON.
Each file defines _POSIX_C_SOURCE 200809L ahead of its includes, so the
dependency is visible where it is taken.
(cherry picked from commit 49b48b4)
hjmjohnson
force-pushed
the
pr/c11-standard
branch
from
September 24, 2026 11:59
49b48b4 to
cad7949
Compare
hjmjohnson
marked this pull request as ready for review
September 24, 2026 12:00
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.
The build never set a C standard, so it used the compiler default. Set
CMAKE_C_STANDARD 11 with C_EXTENSIONS OFF.
Two POSIX dependencies were being satisfied silently by the gnu default
and now have to be requested:
cifti/afni_xml.c strdup(), 3 uses. Without a declaration this was
an implicit function declaration returning int
assigned to char * -- an error in C99 onward.
nifti1_io.c, popen()/pclose() in the optional PIGZ write path,
nifti2_io.c only compiled with -DFSLSTYLE_PIGZ_SUPPORT=ON.
Each file defines _POSIX_C_SOURCE 200809L ahead of its includes, so the
dependency is visible where it is taken.
Interface impact: none. On the union of all these changes, configured with
USE_FSL_CODE=ONandUSE_CIFTI_CODE=ON: all 448 exported symbols acrosslibniftiio,libnifti2,libznz,libfslio,libnifticdfandlibciftiare identical tomasterundernm -D --defined-only, and all ten installed headers are identical undergcc -E -P. Undergcc -dM -Eone macro definition differs, intentionally and only in text: #61 makesFSL_RADIOLOGICALread(-1)so it is safe inside an expression. Its value is still-1, checked by compiling against each installedfslio.hand printing it.Verification. This branch: builds with gcc 16.1.1,
ctestunchanged frommaster(2 of 345 fail onmasteritself in this environment; #31 and #29 each fix one). The union of all the PRs: 0 errors under both gcc 16.1.1 and clang 22.1.8,ctest345/345 under each, and the whole suite under valgrind memcheck with--trace-children=yesgives 484 traced processes with no invalid access, no uninitialised value and no leak in any nifti binary.Coordination. Every line of every branch was compared, whitespace-normalised, against the diffs of the open PRs (#11, #21, #22, #23, #24). Where one of those already changes a line, the line was left alone, and the few deliberate overlaps are named in the text above. What survives is 17 compiler warnings, all of them on those lines: 9
-Wsign-conversion(5 infslio.cfor #22, 2 innifti2_io.cand 2 innifti_tester001.cfor #24) and 8-Wcalloc-transposed-argsinnifti_findhdrnameandnifti_findimgname, which #11 rewrites. No formatting changes appear anywhere, to stay clear of #10 and #12.One of a set of independent, single-purpose PRs. Each bases on
masterand can be merged on its own, in any order.The full set of PRs (35)
The union of all of them is on the fork as
all-changes, if you want to build and test the lot at once.CI and build
Configuration and documentation
Defects
Warning and check classes