From: Paul Eggert <eggert@cs.ucla.edu>
To: 47307@debbugs.gnu.org
Subject: bug#47307: Emacs 27.2 RC2 build/check issues on macOS ARM64
Date: Sun, 21 Mar 2021 18:27:32 -0700 [thread overview]
Message-ID: <6027b0e3-b361-cfd0-3b93-3ead504a2be1@cs.ucla.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]
I configured Emacs 27.2 RC2 on macOS 11.2 ARM64 (arm-apple-darwin20.3.0)
using "./configure --with-gnutls=ifavailable" (plain "./configure"
failed, which was disconcerting). When I ran "make" the compiler complained:
editfns.c:2063:18: warning: unsequenced modification and access to
'sa_avail' [-Wunsequenced]
This correctly diagnoses undefined behavior in that C function. I didn't
investigate what happens on that platform is as it's easier to fix the
problem on all platforms. I propose installing the attached
obviously-safe patch into the emacs-27 branch.
There were several deprecation warnings when compiling but I assume we
don't care about them in this older branch.
"make check" reported four unexpected failures. Perhaps a macOS expert
could be persuaded to look into them. A tarball of the failed logs is
attached.
[-- Attachment #2: 0001-Fix-replace-buffer-contents-undefined-behavior.patch --]
[-- Type: text/x-patch, Size: 1496 bytes --]
From f85db942100f4a129d4b9efba5707b954cbf2121 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 21 Mar 2021 18:08:13 -0700
Subject: [PATCH] Fix replace-buffer-contents undefined behavior
* src/editfns.c (Freplace_buffer_contents): Avoid undefined
behavior with competing side effects in parallel subexpressions.
Problem reported by Apple clang version 12.0.0 (clang-1200.0.32.29).
---
src/editfns.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/editfns.c b/src/editfns.c
index 621e35171d..cd9633d4c6 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2053,6 +2053,8 @@ DEFUN ("replace-buffer-contents", Freplace_buffer_contents,
code. */
ptrdiff_t del_bytes = (size_t) size_a / CHAR_BIT + 1;
ptrdiff_t ins_bytes = (size_t) size_b / CHAR_BIT + 1;
+ unsigned char *deletions = SAFE_ALLOCA (del_bytes);
+ unsigned char *insertions = SAFE_ALLOCA (ins_bytes);
struct context ctx = {
.buffer_a = a,
.buffer_b = b,
@@ -2060,8 +2062,8 @@ DEFUN ("replace-buffer-contents", Freplace_buffer_contents,
.beg_b = min_b,
.a_unibyte = BUF_ZV (a) == BUF_ZV_BYTE (a),
.b_unibyte = BUF_ZV (b) == BUF_ZV_BYTE (b),
- .deletions = SAFE_ALLOCA (del_bytes),
- .insertions = SAFE_ALLOCA (ins_bytes),
+ .deletions = deletions,
+ .insertions = insertions,
.fdiag = buffer + size_b + 1,
.bdiag = buffer + diags + size_b + 1,
.heuristic = true,
--
2.27.0
[-- Attachment #3: emacs-27.2-RC2-failures-macOS11.2-ARM.tar.gz --]
[-- Type: application/gzip, Size: 4677 bytes --]
next reply other threads:[~2021-03-22 1:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 1:27 Paul Eggert [this message]
2021-03-22 8:54 ` bug#47307: Emacs 27.2 RC2 build/check issues on macOS ARM64 Michael Albinus
2021-03-22 16:23 ` Paul Eggert
2021-03-22 16:59 ` Philipp Stephani
2021-03-23 8:40 ` Michael Albinus
2021-03-22 17:20 ` Eli Zaretskii
2021-03-25 15:16 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6027b0e3-b361-cfd0-3b93-3ead504a2be1@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=47307@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.