Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails with gcc-14 #994

Open
paparodeo opened this issue Dec 6, 2024 · 1 comment
Open

build fails with gcc-14 #994

paparodeo opened this issue Dec 6, 2024 · 1 comment

Comments

@paparodeo
Copy link

paparodeo commented Dec 6, 2024

host/utilities/bladeRF-fsk/c/src/fir_filter.c:227:28:
error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
227 | outbuf = calloc(sizeof(struct complex_sample), chunk_size);

https://cache.nixos.org/log/hsg1v3cl1hk9ca77rgkng6n6dabz1bi3-libbladeRF-2.5.0.drv

transposing the args to calloc so chunk_size is passed as the number of elements (which seems correct given the later call to fread).

diff --git a/host/utilities/bladeRF-fsk/c/src/fir_filter.c b/host/utilities/bladeRF-fsk/c/src/fir_filter.c
index 59f34f0..7def697 100644
--- a/host/utilities/bladeRF-fsk/c/src/fir_filter.c
+++ b/host/utilities/bladeRF-fsk/c/src/fir_filter.c
@@ -213,18 +213,18 @@ int main(int argc, char *argv[])
         return EXIT_FAILURE;
     }
 
-    inbuf = calloc(2*sizeof(int16_t), chunk_size);
+    inbuf = calloc(chunk_size, 2*sizeof(int16_t));
     if (!inbuf) {
         perror("calloc");
         goto out;
     }
-    tempbuf = calloc(2*sizeof(int16_t), chunk_size);
+    tempbuf = calloc(chunk_size, 2*sizeof(int16_t));
     if (!tempbuf) {
         perror("calloc");
         goto out;
     }
 
-    outbuf = calloc(sizeof(struct complex_sample), chunk_size);
+    outbuf = calloc(chunk_size, sizeof(struct complex_sample));
     if (!outbuf) {
         perror("calloc");
         goto out;
@paparodeo
Copy link
Author

duplicate of #972
PR for fix is #984

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

No branches or pull requests

1 participant