Control: tag -1 patch

On Tue, Mar 12, 2024 at 06:31:20PM +0100, Andreas Tille wrote:
 
> I can confirm that this bug also occures on amd64 thus removing the
> arm-restriction from the title.  Unfortunately I have no idea how to fix
> this (except by possibly suppressing the -Werror=implicit-function-declaration
> option).  Thus tagging 'help'

Looks like bam_view1() and bam_sort_core() don't have prototypes in
any header file in libbam-dev. Copying them from the actual .c files
in samtools-legacy seems to work.

Patch attached, this builds and passes the test suite for me.
-- 
Niko
>From 3ddc905c9ceb635c6c876de1d372eedaa45de425 Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Tue, 12 Mar 2024 20:53:33 +0000
Subject: [PATCH] Lift prototypes of bam_view1 and bam_sort_core from bam.c in
 samtools-legacy

This fixes builds with gcc -Werror=implicit-function-declaration .

Bug-Debian: https://bugs.debian.org/1065759
---
 lib/Bio/DB/Sam.xs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/Bio/DB/Sam.xs b/lib/Bio/DB/Sam.xs
index 023f655..2231477 100644
--- a/lib/Bio/DB/Sam.xs
+++ b/lib/Bio/DB/Sam.xs
@@ -32,6 +32,11 @@
 /* stolen from bam_aux.c */
 #define MAX_REGION 1<<29
 
+/* stolen from bam.c */
+extern void bam_view1(const bam_header_t *header, const bam1_t *b);
+/* stolen from bam_sort.c */
+extern void bam_sort_core(int is_by_qname, const char *fn, const char *prefix, size_t max_mem);
+
 typedef tamFile         Bio__DB__Tam;
 typedef faidx_t*        Bio__DB__Sam__Fai;
 typedef bamFile         Bio__DB__Bam;
-- 
2.43.0

Reply via email to