community/dump1090: fix build with gcc 14

This commit is contained in:
mio 2024-08-23 21:59:21 +00:00 committed by omni
parent 2206f05545
commit fb9c98016d
2 changed files with 28 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=dump1090
pkgver=9.0
pkgrel=0
pkgrel=1
pkgdesc="Dump1090 is a simple Mode S decoder for RTLSDR devices"
arch="all"
url="https://github.com/flightaware/dump1090"
@ -12,7 +12,8 @@ depends="
bladerf
"
makedepends="ncurses-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/flightaware/dump1090/archive/refs/tags/v$pkgver.tar.gz"
source="$pkgname-$pkgver.tar.gz::https://github.com/flightaware/dump1090/archive/refs/tags/v$pkgver.tar.gz
gcc14-werror-calloc.patch"
build() {
make all faup1090 EXTRACFLAGS=-DHTMLPATH=\\\"/usr/share/dump1090/html\\\"
@ -32,4 +33,5 @@ package() {
sha512sums="
07408c5680e626eccd3f74d35a6e8a7538dfffd31675f036580003dbba2a78f2487e1980d72d3ec7e44d3f94880e3f231ab1c97bd99ba1ca6cdcfa0ebf198aff dump1090-9.0.tar.gz
54970b9e25dc6963e81d1309f5f45abefbe875eb8be54ff3b825fcfd44121368525c57409207258d5af7f97454a888f875dc1dc6f1e6f5fdd33b70a7bd0bc963 gcc14-werror-calloc.patch
"

View File

@ -0,0 +1,24 @@
Fix -Werror=calloc-transposed-args error with gcc 14.
--- dump1090-9.0-origin/adaptive.c
+++ dump1090-9.0/adaptive.c
@@ -195,7 +195,7 @@
adaptive_burst_window_remaining = adaptive_samples_per_window;
adaptive_burst_window_counter = 0;
- adaptive_range_radix = calloc(sizeof(unsigned), 65536);
+ adaptive_range_radix = calloc(65536, sizeof(unsigned));
adaptive_range_state = RANGE_RESCAN_UP;
// select and enforce gain limits
--- dump1090-9.0-origin/net_io.c
+++ dump1090-9.0/net_io.c
@@ -104,7 +104,7 @@
{
struct net_service *service;
- if (!(service = calloc(sizeof(*service), 1))) {
+ if (!(service = calloc(1, sizeof(*service)))) {
fprintf(stderr, "Out of memory allocating service %s\n", descr);
exit(1);
}