Fix stringop-overread issue and quality-of-life#1
Open
joergen7 wants to merge 4 commits into
Open
Conversation
Author
|
Hello, I realize that one of the changes I'm proposing touches an upstream repository: gtkwave. Do you want me to revert the changes to |
Author
|
The improvement of setup.py remains. |
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.
This pr contributes a few quality-of-life improvements that I have come across. It fixes a stringop-overread warning issued by the C compiler at build, sets the minimum cmake version to a non-deprecated version, and replaces a deprecated call to distutils.
Fix stringop-overread Warning
Observation
When building pylibfst the C-compiler outputs the following warning:
This is due to the function
fstVcdIDForFwritewhich produces id strings of unbounded size. This function is applied, however, to arrays whose size is only 16. Two bytes of such an array are reserved for delimiters. Thus, the maximum allowable size of an id string is 14.Execution
This pr explicitly limits the size of an id string to 14, thus removing the warning.
Remove deprecated function find_executable
Observation
In the build process when
setup.pyis run, the Python runtime complains about the use of the functiondistutils.find_executablewhich it flags as deprecated.Execution
As suggested, this pr replaces
distutils.find_executablewithshutil.which. Imho, it would be advisable to ditch the dependency fromdistutilsentirely.Fix cmake minimum version
Observation
When using contemporary distributions of
cmakea warning is issued that versions before 3.10 are deprecated. I have been using cmake version 3.31.1 which ships with Alpine Linux 3.21.0.Execution
I have set the minimum version of cmake to 3.10.