Control: tag -1 upstream fixed-upstream patch

On Wed, 03 Jul 2024 12:33:34 +0000 Matthias Klose <d...@debian.org> wrote:
> Package: src:libliftoff
> Version: 0.4.1-1
> Usertags: ftbfs-gcc-14
> 
> The package fails to build in a test rebuild on at least amd64 with
> gcc-14/g++-14, but succeeds to build with gcc-13/g++-13. The
> severity of this report will be raised before the trixie release.

https://gitlab.freedesktop.org/emersion/libliftoff/-/merge_requests/78 is the 
upstream MR which fixes that issue. It has been merged and is part of the 0.5.0 
release, which the tracker (apparently) doesn't see, but was tagged on 
2024-05-28.

So the best solution seems to package version 0.5.0?

Alternatively, you can add the attached patch.
https://salsa.debian.org/diederik/libliftoff/-/tree/gcc-14-compat
can also be turned into a MR and via that you can see it does build 
successfully with GCC-14, while without it, the build failed.

HTH,
  Diederik
>From 29a06add8ef184f85e37ff8abdc34fbaa2f4ee1e Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <sly...@gmail.com>
Date: Thu, 21 Dec 2023 20:15:29 +0000
Subject: [PATCH] layer.c: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)

`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `libliftoff`:

    ../layer.c: In function 'liftoff_layer_create':
    ../layer.c:20:48: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in t
    ument [-Werror=calloc-transposed-args]
       20 |         layer->candidate_planes = calloc(sizeof(layer->candidate_planes[0]),
          |                                                ^
    ../layer.c:20:48: note: earlier argument should specify number of elements, later size of each element
---
 layer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layer.c b/layer.c
index 73a8186..6510ea7 100644
--- a/layer.c
+++ b/layer.c
@@ -17,8 +17,8 @@ liftoff_layer_create(struct liftoff_output *output)
 		return NULL;
 	}
 	layer->output = output;
-	layer->candidate_planes = calloc(sizeof(layer->candidate_planes[0]),
-					 output->device->planes_cap);
+	layer->candidate_planes = calloc(output->device->planes_cap,
+					 sizeof(layer->candidate_planes[0]));
 	if (layer->candidate_planes == NULL) {
 		liftoff_log_errno(LIFTOFF_ERROR, "calloc");
 		free(layer);
--
GitLab

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to