Fix incompatible sft pointer types in sf_ntrianglen_init - #331
Open
cplusv2023 wants to merge 1 commit into
Open
Conversation
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.
Problem
sf_ntrianglen_init()expects the shift argument to befloat **sft, but several real-valued programs and intermediate functions underuser/chenykstill declared and passed it asint **sft.This caused build failures such as:
Since GCC 14, incompatible pointer types are treated as errors by default. Although the diagnostic can be downgraded using
-Wno-error=incompatible-pointer-types, doing so does not make the code valid: passingint **wherefloat **is expected causes the underlying integer data to be accessed as floating-point data, resulting in undefined behavior.Changes
sftfromint **tofloat **throughout the affected real-valued call chainsM*.cprograms to allocate floating-point shift arraysshift#inputs by reading them into a temporary integer buffer and converting them to floatshift#inputs to be read directlycntrianglencall chain unchangedAffected call chains
sf_ntrianglen_initdivnn_initdivnn_sc_init2dip3n_initodipn_initwarpscann_initThe primary purpose of this change is to fix the incompatible pointer types in the real-valued non-stationary smoothing implementation.