Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Many configure tests broken with clang 12
- X-seq: zsh-workers 47565
- From: FX <fxcoudert@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Many configure tests broken with clang 12
- Date: Mon, 16 Nov 2020 12:34:43 +0100
- Archived-at: <https://zsh.org/workers/47565>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-11/6C43F788-B057-4C5B-8FDD-932AC300549D%40gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-wm1-f41.google.com) smtp.remote-ip=209.85.128.41; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=b51jcg1yIrqs3wV2mxfb+ztfOaGbzuEapzBfftv31z8=; b=sViz5afXb7VEuWTIGmH6PK/HUTkHlPw4Bm3ydKkJ54d2K0O8Nb6/wrLoWeSLPYSW8t tES7XRnDgOpfdCwodKF3UC3o4bteQzL+EnRXo/m2Ll42Og3lNyMmgqe6aDtX6nCQ+Y/j wpWM+BKk64ImhmvmK+9vXePWiGZwsTuW44hsCMVOpwpeXcA9Z3U0TTqru4F3CSGWy0YC XufEzx/CAkR21Qd/Gp+VdSQUFz8aV4DIXqst6EAJWPhhz/D4u+XR8MlPjmPM50qlH+55 EUSFv6M48SJdaRu2d00iu7elZkPFa9cizXqXAL/Cy9O6TSgUAZ1ltvZZiCP0if5wQbbh nWgA==
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- Sender: zsh-workers-request@xxxxxxx
Hello,
Building zsh 5.8 with clang 12 (which is the system compiler on recent macOS versions) leads to a completely broken zsh. This is because many configure tests actually fail, when they should succeed, because of undeclared functions. Take for example TGETENT_ACCEPTS_NULL in configure.ac:
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
main()
{
char buf[4096];
int r1 = tgetent(buf, "vt100");
int r2 = tgetent((char*)0,"vt100");
if (r1 >= 0 && r1 == r2) {
char tbuf[1024], *u;
u = tbuf;
tgetstr("cl", &u);
creat("conftest.tgetent", 0640);
}
exit((r1 != r2) || r2 == -1);
}
]])]
This will fail for two reasons:
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
tgetstr() should require the <term.h> header to be included in the test. And exit() needs <stdlib.h>
This occurs in a lot of places throughout the configure script. I have found the list below (see at end of message). clang 12 has made -Wimplicit-function-declaration into an error by default, which explains why these tests are now starting to fail. See our original report on Homebrew: https://github.com/Homebrew/homebrew-core/issues/64921
Best regards,
FX
fx@rmeur zsh-5.8 % grep 'implicitly declaring' config.log
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:255:24: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:255:40: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:293:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:287:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:302:9: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:286:5: error: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
conftest.c:288:14: error: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:31: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:320:13: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
fx@rmeur zsh-5.8 % grep 'C99' config.log
conftest.c:228:14: error: implicit declaration of function 'tgetent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:234:2: error: implicit declaration of function 'creat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:228:14: error: implicit declaration of function 'tgetent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:234:2: error: implicit declaration of function 'creat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:287:5: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:289:8: error: implicit declaration of function 'mkfifo' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:294:11: error: implicit declaration of function 'fork' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:299:17: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:302:22: error: implicit declaration of function 'write' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:286:27: error: implicit declaration of function 'getpid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:286:37: error: implicit declaration of function 'rand' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:298:5: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
Messages sorted by:
Reverse Date,
Date,
Thread,
Author