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

Xcode 12 and -Werror=implicit-function-declaration #203

Merged
merged 1 commit into from
Sep 18, 2020
Merged

Xcode 12 and -Werror=implicit-function-declaration #203

merged 1 commit into from
Sep 18, 2020

Conversation

martelletto
Copy link
Contributor

Hi,

Xcode 12 (released 2020-09-16) enabled -Werror=implicit-function-declaration by default:

https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes

This positively confuses configure.ac:

checking compiler and flags for sanity... no
configure: error: *** compiler cannot create working executables, check config.log ***

With that particular test fixed, configure runs to completion, but there are other occurrences:

conftest.c:71:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:113:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:231:15: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:247:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:252:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:252:7: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:253:2: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:250:35: error: implicitly declaring library function '_exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:267:13: error: implicit declaration of function 'fork' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:268:9: error: implicit declaration of function 'getppid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:269:3: error: implicit declaration of function 'sleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:370:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:382:1: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:382:1: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:371:27: error: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-declaration]
conftest.c:376:42: error: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-declaration]
conftest.c:376:23: error: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-declaration]
conftest.c:398:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:406:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]

This is an attempt to fix configure.ac so that the relevant header files are always included.

-p.

when testing, make sure to include the relevant header files that
declare the types of the functions used by the test:

- stdio.h for printf();
- stdlib.h for exit();
- string.h for strcmp();
- unistd.h for unlink(), _exit(), fork(), getppid(), sleep().
@djmdjm djmdjm merged commit dc09840 into openssh:master Sep 18, 2020
@martelletto martelletto deleted the implicit-function branch September 18, 2020 07:47
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 this pull request may close these issues.

2 participants