Skip to content

compiler error, [-Wimplicit-function-declaration] #391

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

Closed
carlhung opened this issue Apr 22, 2023 · 5 comments · Fixed by #395
Closed

compiler error, [-Wimplicit-function-declaration] #391

carlhung opened this issue Apr 22, 2023 · 5 comments · Fixed by #395

Comments

@carlhung
Copy link

carlhung commented Apr 22, 2023

I tried to create my own docker image. because the current Carton docker doesn't have lldb debugger and soucekip-lsp. So, I tried to create my own.
But when i typed:

$ swift build -c release

I got the following error:

/app/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:10:12: error: call to undeclared function 'posix_spawn_file_actions_addchdir_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    return posix_spawn_file_actions_addchdir_np(file_actions, path);
           ^
/app/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:10:12: note: did you mean 'SPM_posix_spawn_file_actions_addchdir_np'?
/app/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:7:5: note: 'SPM_posix_spawn_file_actions_addchdir_np' declared here
int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict file_actions, const char *restrict path) {
    ^
1 error generated.
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[8/882] Compiling a_object.c

To show my linux version with command, uname -a

Linux 94c915263026 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

swift's version:

Swift version 5.8 (swift-5.8-RELEASE)
Target: x86_64-unknown-linux-gnu

my clang version with command, clang --version

clang version 13.0.0 (https://github.com/apple/llvm-project.git f0fb631dd1a3a2988b23ba5057cd9106713cd0b4)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
@Soutaisei
Copy link

Can confirm I have the same issue on PopOS (which is based on Ubuntu) when trying to build with the install_ubuntu_deps.sh

@kateinoigakukun
Copy link
Member

Thank you for your reports. It will be resolved by swiftlang/swift-tools-support-core#363, which will be included in the next carton release. So just a moment, please 🙏

@kateinoigakukun kateinoigakukun linked a pull request May 4, 2023 that will close this issue
@Soutaisei
Copy link

Can confirm that I no longer have the error after the update.
Built and runs fine on Swift 5.8

@carlhung
Copy link
Author

carlhung commented May 6, 2023

Ok. But does it work? I mean, have you tried to run the sample code and see something on the browser?

@Soutaisei
Copy link

Soutaisei commented May 6, 2023

Ok. But does it work? I mean, have you tried to run the sample code and see something on the browser?

Correct. I've tested it and it works fine.
Tried it on two linux machines with different distros.

(You will just have to specify snapshot version of swift-wasm 5.8 in .swift-version to have it to work as well)

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

Successfully merging a pull request may close this issue.

3 participants