bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / code / Atom feed
* [PATCH 1/2] Fix ChangeLog typo.
@ 2023-01-13 22:33 Paul Eggert
  2023-01-13 22:33 ` [PATCH 2/2] verify: work around xlclang 16.1 compiler bug Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggert @ 2023-01-13 22:33 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

---
 ChangeLog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index eb19f7dc0f..3799832c09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,7 +13,7 @@
 	Don’t use alloc_size with xlclang 16.1
 	* m4/gnulib-common.m4 (_GL_HAS_ATTRIBUTE): Require Clang 5 instead
 	of 3.5 for this, to pacify xlclang 16.1.0 on AIX 7.2, which
-	advertises itself as clang 4.1.0, and which otherwise issues
+	advertises itself as clang 4.0.1, and which otherwise issues
 	warnings like “./xalloc.h:141:3: warning: 1540-2990 The attribute
 	"__attribute__((alloc_size(2, 3)))" is not supported.  The
 	attribute is ignored.” when building bleeding-edge GNU grep.
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] verify: work around xlclang 16.1 compiler bug
  2023-01-13 22:33 [PATCH 1/2] Fix ChangeLog typo Paul Eggert
@ 2023-01-13 22:33 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2023-01-13 22:33 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html
* lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE):
Define to 0 if compiler advertises itself as clang before version 5.
xlclang 16.1 advertises itself as 4.0.1 and this patch works
around what appears to be a compiler bug when compiling dfa.c in
bleeding-edge grep.
---
 ChangeLog    | 9 +++++++++
 lib/verify.h | 8 ++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3799832c09..dc8fb2c12b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2023-01-13  Paul Eggert  <eggert@cs.ucla.edu>
 
+	verify: work around xlclang 16.1 compiler bug
+	Problem reported by Bruno Haible in:
+	https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html
+	* lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE):
+	Define to 0 if compiler advertises itself as clang before version 5.
+	xlclang 16.1 advertises itself as 4.0.1 and this patch works
+	around what appears to be a compiler bug when compiling dfa.c in
+	bleeding-edge grep.
+
 	assert-h: suppress xlclang 16.1 false alarms
 	* m4/assert_h.m4 (gl_ASSERT_H): Pacify older clangs too,
 	with regard to single-argument static_assert.
diff --git a/lib/verify.h b/lib/verify.h
index 17d6e78c81..b63cb26432 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -258,7 +258,9 @@ template <int w>
 
 /* @assert.h omit start@  */
 
-#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_TRAP 0
+#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
 # define _GL_HAS_BUILTIN_TRAP 1
 #elif defined __has_builtin
 # define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
@@ -266,7 +268,9 @@ template <int w>
 # define _GL_HAS_BUILTIN_TRAP 0
 #endif
 
-#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
 # define _GL_HAS_BUILTIN_UNREACHABLE 1
 #elif defined __has_builtin
 # define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-13 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 22:33 [PATCH 1/2] Fix ChangeLog typo Paul Eggert
2023-01-13 22:33 ` [PATCH 2/2] verify: work around xlclang 16.1 compiler bug Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://public-inbox.org/mirrors/gnulib.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).