Repository navigation
ENH: Give the cifti tools' gopt internal linkage - #118
Merged
Merged
Conversation
afni_xml_tool.c and cifti_tool.c each define a file-scope `opts_t gopt` with external linkage, so the two share a symbol name and neither declares it in a header. Each is used only inside its own translation unit, always by address. Both files build executables rather than libraries, so `static` removes nothing from any shared library's exported symbols. Clears both -Wmissing-variable-declarations warnings. (cherry picked from commit a2d3b5c)
hjmjohnson
force-pushed
the
pr/fix-missing-variable-declarations
branch
from
October 6, 2026 14:34
7c7cb01 to
c7267fa
Compare
gdevenyi
approved these changes
Nov 12, 2026
gdevenyi
left a comment
Collaborator
There was a problem hiding this comment.
Review by Google Carbon
Verdict: Approve
Verified that gopt is strictly file-local to the afni_xml_tool and cifti_tool executables (neither linked into libcifti nor referenced outside each .c file; zero shared-library ABI impact) and remains zero-initialized static storage as before. This brings Clang's -Wmissing-variable-declarations count across the entire tree from 2 down to 0!
seanm
approved these changes
Nov 13, 2026
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.
Re-submission of #36, reverted from
masteron 2026-09-24 so it can bereviewed before merging. Content is unchanged from the original.
Base:
master. Independent: nothing has to land before it.Commits
Ordering for all the re-submitted work is tracked in #84.