Opened 3 years ago

Closed 3 years ago

#61975 closed defect (fixed)

codec2 @20210101-1f701514 fails to build using Xcode 12 due to implicitly declared library functions

Reported by: michaelld (Michael Dickens) Owned by: ra1nb0w
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: codec2

Description

From the build log:

:info:build /opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_audio_codec2/codec2/work/codec2-1f70151444f9add31848905946abcf2dd12d5c0e/src/c2dec.c:114:13: warning: unused variable 'nread' [-Wunused-variable]
:info:build         int nread = fread(&in_hdr,sizeof(in_hdr),1,fin);
:info:build             ^
:info:build /usr/bin/clang -pipe -Os -DNDEBUG -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -Wall -Wno-strict-overflow -std=gnu11 -fPIC -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk CMakeFiles/vhf_frame_c2.dir/vhf_frame_c2.c.o -o vhf_frame_c2  -Wl,-rpath,/opt/local/lib -lm libcodec2.0.9.dylib -lm 
:info:build /opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_audio_codec2/codec2/work/codec2-1f70151444f9add31848905946abcf2dd12d5c0e/src/fmfsk_mod.c:47:9: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
:info:build         exit(1);
:info:build         ^
:info:build /opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_audio_codec2/codec2/work/codec2-1f70151444f9add31848905946abcf2dd12d5c0e/src/fmfsk_mod.c:47:9: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
:info:build /usr/bin/clang -pipe -Os -DNDEBUG -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -Wall -Wno-strict-overflow -std=gnu11 -fPIC -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk CMakeFiles/cohpsk_get_test_bits.dir/cohpsk_get_test_bits.c.o -o cohpsk_get_test_bits  -Wl,-rpath,/opt/local/lib -lm libcodec2.0.9.dylib -lm 
:info:build /opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_audio_codec2/codec2/work/codec2-1f70151444f9add31848905946abcf2dd12d5c0e/src/fmfsk_mod.c:51:10: error: implicit declaration of function 'atoi' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build     Fs = atoi(argv[1]);
:info:build          ^
:info:build /opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_audio_codec2/codec2/work/codec2-1f70151444f9add31848905946abcf2dd12d5c0e/src/fmfsk_mod.c:76:24: error: implicitly declaring library function 'alloca' with type 'void *(unsigned long)' [-Werror,-Wimplicit-function-declaration]
:info:build     bitbuf = (uint8_t*)alloca(sizeof(uint8_t)*fmfsk->nbit);
:info:build                        ^
:info:build /opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_audio_codec2/codec2/work/codec2-1f70151444f9add31848905946abcf2dd12d5c0e/src/fmfsk_mod.c:76:24: note: include the header <stdlib.h> or explicitly provide a declaration for 'alloca'
:info:build 3 errors generated.

Good chance there will be more of these in files further into the build.

Change History (7)

comment:1 Changed 3 years ago by michaelld (Michael Dickens)

Owner: set to ra1nb0w
Status: newassigned

comment:2 Changed 3 years ago by michaelld (Michael Dickens)

I'm using macOS 11.2 20D5029f & Xcode 12.3 12C33 ... but the issue is with the implicitly defined C functions, not the beta OS

comment:3 Changed 3 years ago by ra1nb0w

comment:4 in reply to:  3 Changed 3 years ago by michaelld (Michael Dickens)

Replying to ra1nb0w:

can you try https://github.com/ra1nb0w/codec2/tree/implicit ?

That does the trick! Thx!

comment:5 Changed 3 years ago by ra1nb0w

Ok. I wait upstream to merge the patch. If they don't answer within 1 days I put the patch on macports. Happy new year to you and your family :)

comment:6 in reply to:  5 Changed 3 years ago by michaelld (Michael Dickens)

Replying to ra1nb0w:

Ok. I wait upstream to merge the patch. If they don't answer within 1 days I put the patch on macports. Happy new year to you and your family :)

Sounds good & thank you; I wish you & yours a very happy new year right back!

comment:7 Changed 3 years ago by Davide Gerhard <ra1nb0w@…>

Resolution: fixed
Status: assignedclosed

In d562a64baa3b83040e6abe82a246097c759d09bf/macports-ports (master):

codec2: fix implicitly declaring library function

waiting upstream PR

Closes: #61975

Note: See TracTickets for help on using tickets.