[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnulib-bug
Subject:    [PATCH 3/6] Support clang for explicit_bzero
From:       roucaries.bastien () gmail ! com
Date:       2020-04-12 0:48:24
Message-ID: 20200412004827.51575-4-rouca () debian ! org
[Download RAW message or body]

From: Bastien Roucariès <rouca@debian.org>

According to https://bugs.llvm.org/show_bug.cgi?id=15495#c11
llvm need g type constraint

Signed-off-by: Bastien Roucariès <rouca@debian.org>
---
 lib/explicit_bzero.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index 489732791..bb52d11de 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -56,9 +56,13 @@ explicit_bzero (void *s, size_t len)
   (void) memset_s (s, len, '\0', len);
 #else
   memset (s, '\0', len);
-# if defined __GNUC__ && !defined __clang__
+#if defined __GNUC__
+# if !defined __clang__
   /* Compiler barrier.  */
   asm volatile ("" ::: "memory");
+# else
+   /* https://bugs.llvm.org/show_bug.cgi?id=15495#c11 */
+  __asm__ volatile("" : : "g"(s) : "memory");
 # endif
 #endif
 }
-- 
2.25.1


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic