Skip to content

Fix vcfstats.c on big-endian platforms#2569

Merged
pd3 merged 1 commit into
samtools:developfrom
jmarshall:bigendian
Jun 16, 2026
Merged

Fix vcfstats.c on big-endian platforms#2569
pd3 merged 1 commit into
samtools:developfrom
jmarshall:bigendian

Conversation

@jmarshall

Copy link
Copy Markdown
Member

Byteswap as appropriate. As mentioned in PR #2044, this may avoid problems with unaligned access on little-endian platforms too.

After application of this PR, bcftools's tests pass on s390x.

Note that there still exist numerous #define BRANCH… macros that do not have a convert parameter. These presumably represent functionality that is not big-endian-correct but which is not exercised by the test suite.

Use htslib/hts_endian.h functions to avoid problems with unaligned access,
and to ensure numbers are byteswapped on platforms that need it.

Signed-off-by: John Marshall <jmarshall@hey.com>
@pd3 pd3 merged commit 15a4091 into samtools:develop Jun 16, 2026
8 checks passed
@pd3

pd3 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Thank you

@jmarshall jmarshall deleted the bigendian branch June 17, 2026 06:25
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.

2 participants