GCC 14.1.1 Compiler error with M5EVT Linhpsdr

69 views
Skip to first unread message

Doug Lung

unread,
Jun 26, 2024, 10:20:26 PM (6 days ago) Jun 26
to Hermes-Lite
After installing the binary version of Linhpsdr (linhpsdr-0-0.11.20210710git742658a9.fc40.x86_64) in Fedora and reading about the changes and improvements in Matthew's version I decided to try building it but ran into a problem with the GCC 14 compiler in Fedora 40:

audio.c: In function ‘audio_open_input’:
audio.c:627:37: error: assignment to ‘float *’ from incompatible pointer type ‘gint16 *’ {aka ‘short int
*’} [-Wincompatible-pointer-types]
 627 |           r->local_microphone_buffer=g_new(gint16, r->local_microphone_buffer_size);
     |                                     ^
audio.c:631:37: error: assignment to ‘float *’ from incompatible pointer type ‘gint32 *’ {aka ‘int *’} [-
Wincompatible-pointer-types]
 631 |           r->local_microphone_buffer=g_new(gint32, r->local_microphone_buffer_size);
     |                                     ^
make: *** [Makefile:129: audio.o] Error 1


A Google search showed other programs had similar issues with GCC 14 becoming stricter. My C-programming knowledge is limited so I wanted to see if anyone here had run into this and can suggest how I can fix the errors. If I find a solution I'll post it here. 

Thanks & 73, Doug
AH6DL

Doug Lung

unread,
Jun 26, 2024, 11:11:06 PM (6 days ago) Jun 26
to Hermes-Lite
This problem appears to be solved but I haven't tested it on transmit yet.

I changed the "local_microphone_buffer=g_new(gint32...)"  lines to "local_microphone_buffer=g_new(gfloat...)" and it now compiles and runs after commenting out cwdaemon in the Makefile to get around this error:

radio.c: In function ‘create_radio’:
radio.c:1515:19: error: implicit declaration of function ‘cwdaemon_start’ [-Wimplicit-function-declaratio
n]
1515 |     r->cwdaemon = cwdaemon_start();
     |                   ^~~~~~~~~~~~~~
I'll dig into that one after I verify my microphone buffer fix hasn't messed up the transmit audio. I can now see Matthew's enhancements to the original linhpsdr so will keep working on it. 

73, Doug
      AH6DL

Doug Lung

unread,
Jun 27, 2024, 4:01:29 AM (6 days ago) Jun 27
to Hermes-Lite
Changing gint to gfloat for the microphone_buffer works. Transmit audio is fine, although I need to work on the best combination of EQ and compression. 

73,
       AH6DL
Reply all
Reply to author
Forward
0 new messages