Make const ptr assign as function call in clang
- This can act as memory barrier in clang to avoid
read before assign of a const ptr
Signed-off-by: LoveSy <shana@zju.edu.cn>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index bf26c99..e8c3084 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -247,7 +247,7 @@
IF_FEATURE_INDIVIDUAL(, char **argv))
{
#ifdef bb_cached_errno_ptr
- ASSIGN_CONST_PTR(bb_errno, get_perrno());
+ ASSIGN_CONST_PTR(&bb_errno, get_perrno());
#endif
applet_name = applet;