[Lldb-commits] [PATCH] D32787: Fix build error: no viable conversion from returned value of type 'int' to function return type 'sigset_t' (aka '__sigset_t')
Leslie Zhai via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed May 3 00:56:46 PDT 2017
xiangzhai created this revision.
Hi LLVM developers,
Resurrect pselect MainLoop implementation https://reviews.llvm.org/D32600 commited by Pavel, then it failed to build for Linux:
/data/project/LLVM/llvm/tools/lldb/source/Host/common/MainLoop.cpp:158:10: error: no viable conversion from returned value of type 'int' to function return type 'sigset_t' (aka '__sigset_t')
return 0;
^
/usr/include/bits/sigset.h:27:9: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const __sigset_t &' for 1st argument
typedef struct
^
/usr/include/bits/sigset.h:27:9: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to '__sigset_t &&' for 1st argument
1 error generated.
So I simply changed the return value, please review my patch and point out my fault, thanks a lot!
Regards,
Leslie Zhai
Repository:
rL LLVM
https://reviews.llvm.org/D32787
Files:
source/Host/common/MainLoop.cpp
Index: source/Host/common/MainLoop.cpp
===================================================================
--- source/Host/common/MainLoop.cpp
+++ source/Host/common/MainLoop.cpp
@@ -155,7 +155,9 @@
sigset_t MainLoop::RunImpl::get_sigmask() {
#if SIGNAL_POLLING_UNSUPPORTED
- return 0;
+ sigset_t sigmask;
+ memset(sigmask.__val, 0, _SIGSET_NWORDS);
+ return sigmask;
#else
sigset_t sigmask;
int ret = pthread_sigmask(SIG_SETMASK, nullptr, &sigmask);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32787.97565.patch
Type: text/x-patch
Size: 466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170503/bbc3127a/attachment.bin>
More information about the lldb-commits
mailing list