[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1096497: dact: ftbfs with GCC-15



tags 1096497 + patch
user debian-release@lists.debian.org
usertag 1096497 + bsp-2025-10-brazil
thanks

Hi!

On Mon Feb 17, 2025 at 2:09 PM -03, Matthias Klose wrote:
> dact.c: In function ‘main’:
> dact.c:505:46: error: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(int,  unsigned char *, unsigned char *, char *, int,  int)’ [-Wincompatible-pointer-types]
>   505 |                                 algorithms[i]=DACT_FAILED_ALGO;
>       |                                              ^

The main cause of failure is due to the algorithms function array. Going
through the code, I found that the argument types among supported
algorithm functions are not currently the same, though. This means there
is no easy fix here. The situation becomes worse because there is an
analogous ciphers array as well.

Analyzing a bit further, I noticed that the algorithm implementations
actually process the out_block as if it were a pointer to unsigned char,
although declared as signed. It makes sense to be unsigned because these
algorithms are operating on arbitrary byte blobs, which are better
represented with an unsigned type. Something similar happens for the
ciphers.

Therefore, I tried patching up the declarations so that they all share
the same interface, which can be used in the corresponding array
declaration. This attempt can be found as a Merge Request on Salsa [1].
It does build and pass autopkgtests. However, it is harder to know if
anything broke by mistake due to the low test coverage.

Given that this is a quite complex case (for an unmaintained project,
both upstream and in Debian), maybe it is not worth the effort to
maintain such patches. Maybe simply declaring the project requires C17
standard as with the attached patch (thus letting it gradually die) is a
better path forward. Not sure.

I'm looking forward to hearing other opinions on that ;)

[1] https://salsa.debian.org/debian/dact/-/merge_requests/1

--
Henrique F. Simões
From c35901c3fe8af72952677226993c997c36b1f059 Mon Sep 17 00:00:00 2001
From: "Henrique F. Simoes" <henriquesimoes@riseup.net>
Date: Thu, 9 Oct 2025 23:00:46 -0300
Subject: [PATCH] Use gnu17 C standard version

Because C23 drops support for declarators without information about
number and type of parameters and interprets them as without arguments,
the array of algorithms and ciphers are not compatible with C23.

In this case, porting is not straightforward as different algorithms
take arguments of different types (e.g. unsigned char* vs char*). The
same happens for ciphers. Declare that this code should be built with
C17 standard version, so that this porting doesn't need to happen right
now.

Closes: #1096497
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 3c25863..98fe26c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 
 export DEB_BUILD_MAINT_OPTIONS	= hardening=+all
-export DEB_CFLAGS_MAINT_APPEND	= -Wall -pedantic
+export DEB_CFLAGS_MAINT_APPEND	= -Wall -pedantic -std=gnu17
 
 execute_before_dh_builddeb:
 	find debian/dact/ -type d -empty -delete
-- 
2.47.3


Reply to: