From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 13 Dec 2017 00:41:21 +0000 (-0800)
Subject: explicit_bzero: port to macOS + Clang 9.0.0
X-Git-Tag: v1.0~5795
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=81229e828e1939338e0d3de9586b1f00182b41ce;p=gnulib.git

explicit_bzero: port to macOS + Clang 9.0.0

Problem reported by Marcus Johnson (Bug#29658).
* lib/explicit_bzero.c (explicit_bzero) [__clang__]:
Don’t use asm.
---

diff --git a/ChangeLog b/ChangeLog
index 0993f4e06b..8030b80652 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-12-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+	explicit_bzero: port to macOS + Clang 9.0.0
+	Problem reported by Marcus Johnson (Bug#29658).
+	* lib/explicit_bzero.c (explicit_bzero) [__clang__]:
+	Don’t use asm.
+
 2017-12-11  Reuben Thomas  <rrt@sc3d.org>
 
 	doc: Improve explanation of supporting relocatable libraries.
diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index fa06478d0b..0012784791 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -40,7 +40,7 @@ explicit_bzero (void *s, size_t len)
   explicit_memset (s, 0, len);
 #else
   memset (s, '\0', len);
-# ifdef __GNUC__
+# if defined __GNUC__ && !defined __clang__
   /* Compiler barrier.  */
   asm volatile ("" ::: "memory");
 # endif