* bug#72036: 31.0.50; master doesn't build on macOS with clang 18
@ 2024-07-10 14:09 Gerd Möllmann
2024-07-10 15:38 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Gerd Möllmann @ 2024-07-10 14:09 UTC (permalink / raw)
To: 72036
master, HEAD a29a385ee5ea938ed17d94622c7bfd0a10e84830
timespec-sub.c:38:12: error: operand argument to checked integer operation must be an integer type
other than plain 'char', 'bool', bit-precise, or an enumeration ('bool' invalid)
38 | if (v == ckd_sub (&rs, rs, borrow))
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm/18.1.8/lib/clang/18/include/stdckdint.h:38:54: note: expanded from macro
'ckd_sub'
38 | #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
| ^~~
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#72036: 31.0.50; master doesn't build on macOS with clang 18
2024-07-10 14:09 bug#72036: 31.0.50; master doesn't build on macOS with clang 18 Gerd Möllmann
@ 2024-07-10 15:38 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-10 16:16 ` Gerd Möllmann
0 siblings, 1 reply; 4+ messages in thread
From: Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-10 15:38 UTC (permalink / raw)
To: Gerd Möllmann, eggert@cs.ucla.edu, meyering@meta.com; +Cc: 72036
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
(CC'ing Paul Eggert and Jim Meyering, the relevant gnulib maintainers).
On Wednesday, July 10th, 2024 at 14:09, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
> master, HEAD a29a385ee5ea938ed17d94622c7bfd0a10e84830
>
> timespec-sub.c:38:12: error: operand argument to checked integer operation must be an integer type
> other than plain 'char', 'bool', bit-precise, or an enumeration ('bool' invalid)
> 38 | if (v == ckd_sub (&rs, rs, borrow))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> /opt/homebrew/Cellar/llvm/18.1.8/lib/clang/18/include/stdckdint.h:38:54: note: expanded from macro
> 'ckd_sub'
> 38 | #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
> | ^~~
The attached patch to gnulib helps here. I'm using clang version 18.1.8 and the testdir-all build fails if I ./configure CC=clang.
Pip
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-timespec-sub-Fix-compilation-error-on-clang.patch --]
[-- Type: text/x-patch; name=0001-timespec-sub-Fix-compilation-error-on-clang.patch, Size: 1195 bytes --]
From e8400f61b74327c1b7f370b746d282b04355e287 Mon Sep 17 00:00:00 2001
From: Philip Russell <argosphil@murena.io>
Date: Wed, 10 Jul 2024 15:33:05 +0000
Subject: [PATCH] timespec-sub: Fix compilation error on clang.
*lib/timespec-sub.c (timespec_sub): Use 'int' as type of variable.
---
ChangeLog | 5 +++++
lib/timespec-sub.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 21db18416b..aec37eef48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-07-10 Pip Cet <pipcet@protonmail.com>
+
+ timespec-sub: Fix compilation error on clang.
+ * lib/timespec-sub.c (timespec_sub): Use 'int' as type of variable.
+
2024-07-06 Bruno Haible <bruno@clisp.org>
pthread-cond: Fix compilation error on native Windows.
diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c
index f6d948780e..38f9c6a4dc 100644
--- a/lib/timespec-sub.c
+++ b/lib/timespec-sub.c
@@ -31,7 +31,7 @@ struct timespec
timespec_sub (struct timespec a, struct timespec b)
{
int nsdiff = a.tv_nsec - b.tv_nsec;
- bool borrow = nsdiff < 0;
+ int borrow = nsdiff < 0;
time_t rs;
int rns;
bool v = ckd_sub (&rs, a.tv_sec, b.tv_sec);
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#72036: 31.0.50; master doesn't build on macOS with clang 18
2024-07-10 15:38 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-07-10 16:16 ` Gerd Möllmann
2024-07-10 16:29 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Gerd Möllmann @ 2024-07-10 16:16 UTC (permalink / raw)
To: Pip Cet; +Cc: eggert@cs.ucla.edu, meyering@meta.com, 72036
Pip Cet <pipcet@protonmail.com> writes:
> (CC'ing Paul Eggert and Jim Meyering, the relevant gnulib maintainers).
>
> On Wednesday, July 10th, 2024 at 14:09, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
>> master, HEAD a29a385ee5ea938ed17d94622c7bfd0a10e84830
>>
>> timespec-sub.c:38:12: error: operand argument to checked integer operation must be an integer type
>> other than plain 'char', 'bool', bit-precise, or an enumeration ('bool' invalid)
>> 38 | if (v == ckd_sub (&rs, rs, borrow))
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> /opt/homebrew/Cellar/llvm/18.1.8/lib/clang/18/include/stdckdint.h:38:54: note: expanded from macro
>> 'ckd_sub'
>> 38 | #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
>> | ^~~
>
> The attached patch to gnulib helps here. I'm using clang version
> 18.1.8 and the testdir-all build fails if I ./configure CC=clang.
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#72036: 31.0.50; master doesn't build on macOS with clang 18
2024-07-10 16:16 ` Gerd Möllmann
@ 2024-07-10 16:29 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 4+ messages in thread
From: Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-10 16:29 UTC (permalink / raw)
To: Gerd Möllmann
Cc: eggert@cs.ucla.edu, meyering@meta.com, 72036-done@debbugs.gnu.org
On Wednesday, July 10th, 2024 at 16:16, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
> Pip Cet pipcet@protonmail.com writes:
>
> > (CC'ing Paul Eggert and Jim Meyering, the relevant gnulib maintainers).
> >
> > On Wednesday, July 10th, 2024 at 14:09, Gerd Möllmann gerd.moellmann@gmail.com wrote:
> >
> > > master, HEAD a29a385ee5ea938ed17d94622c7bfd0a10e84830
> > >
> > > timespec-sub.c:38:12: error: operand argument to checked integer operation must be an integer type
> > > other than plain 'char', 'bool', bit-precise, or an enumeration ('bool' invalid)
> > > 38 | if (v == ckd_sub (&rs, rs, borrow))
> > > | ^~~~~~~~~~~~~~~~~~~~~~~~~
> > > /opt/homebrew/Cellar/llvm/18.1.8/lib/clang/18/include/stdckdint.h:38:54: note: expanded from macro
> > > 'ckd_sub'
> > > 38 | #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
> > > | ^~~
> >
> > The attached patch to gnulib helps here. I'm using clang version
> > 18.1.8 and the testdir-all build fails if I ./configure CC=clang.
>
>
> Thanks!
Closing this optimistically as Paul pushed a fix.
Pip
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-10 16:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-10 14:09 bug#72036: 31.0.50; master doesn't build on macOS with clang 18 Gerd Möllmann
2024-07-10 15:38 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-10 16:16 ` Gerd Möllmann
2024-07-10 16:29 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).