Wrap ctype.h functions to avoid array subscript warnings#2502
Open
daviesrob wants to merge 1 commit intosamtools:developfrom
Open
Wrap ctype.h functions to avoid array subscript warnings#2502daviesrob wants to merge 1 commit intosamtools:developfrom
daviesrob wants to merge 1 commit intosamtools:developfrom
Conversation
Copy HTSlib's internal wrappers for interfaces in <ctype.h> into bcftools.h (as it's widely included already) and use them on cases where the input has `char` type. For most sources that don't currently include bcftools.h, the required inline function is copied into the top to avoid having to spread bcftools.h dependency to them (in all cases only one function is needed). Fixes "array subscript has type 'char'" warnings on platforms that still implement <ctype.h> interfaces as a macro around an array look-up. ctype interface wrappers were originally authored by John Marshall in HTSlib commit fc9aeb6f7
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.
Copy HTSlib's internal wrappers for interfaces in
<ctype.h>intobcftools.h(as it's widely included already) and use them on cases where the input haschartype. For most sources that don't currently includebcftools.h, the required inline function is copied into the top to avoid having to spreadbcftools.hdependency to them (in all cases only one function is needed).Fixes "array subscript has type 'char'" warnings on platforms that still implement
<ctype.h>interfaces as a macro around an array look-up.