Skip to content

Wrap ctype.h functions to avoid array subscript warnings#2502

Open
daviesrob wants to merge 1 commit intosamtools:developfrom
daviesrob:wrap_ctype_funcs
Open

Wrap ctype.h functions to avoid array subscript warnings#2502
daviesrob wants to merge 1 commit intosamtools:developfrom
daviesrob:wrap_ctype_funcs

Conversation

@daviesrob
Copy link
Member

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant