<div dir="ltr">Works for me:<br><br><div>$ cat > sign.cpp</div><div>#include <vector></div><div>int main() {</div><div> std::vector<int> v;</div><div> int cnt = 3;</div><div> v.resize(cnt * 3);</div><div>
}</div><div>blaikie@blaikie:~/dev/scratch$ clang++ sign.cpp -Wsign-conversion</div><div>sign.cpp:5:16: warning: implicit conversion changes signedness: 'int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion]</div>
<div> v.resize(cnt * 3);</div><div> ~ ~~~~^~~</div><div>1 warning generated.</div><div>blaikie@blaikie:~/dev/scratch$ clang++ sign.cpp -g -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Werror -Wno-error=sign-conversion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=native -Wno-null-conversion -Wno-tautological-compare -Wno-unused-function -std=c++0x -O0<br>
<br><br>So I assume your build system is putting your CXX_FLAGS before some other flags that are re-enabling this warning/error.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Sep 8, 2013 at 1:07 AM, robbinfam <span dir="ltr"><<a href="mailto:tianjiao08@gmail.com" target="_blank">tianjiao08@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>yes,the flags passed to the clang<br>
<br>发自我的 iPhone</div><div><br>在 2013-9-8,0:04,David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> 写道:<br><br></div><div><div class="h5"><blockquote type="cite"><div><div dir="ltr">
<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Sep 7, 2013 at 8:57 AM, Fan Yu <span dir="ltr"><<a href="mailto:tianjiao08@gmail.com" target="_blank">tianjiao08@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi, I got a problem when using clang++ 3.2 at my C++ project.<div>
<br></div><div>I use CXXFLAGS like :</div>
<div><br></div><div>-- CXX_FLAGS = -g -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Werror -Wno-error=sign-conversion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=native -Wno-null-conversion -Wno-tautological-compare -Wno-unused-function -std=c++0x -O0<br>
</div></div></blockquote><div><br></div><div>Are you sure those flags are actually getting passed to your compile command?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>
</div><div><br></div><div>I use -Wno-sign-conversion to disable the warning, but I still got the error, How can I disable it, anyone can help me? thank you</div><div><div>/home/ubuntu/claire/claire-common/claire/common/eventloop/poller/EPollPoller.cc:112:13: error: implicit conversion changes signedness: 'int' to 'unsigned int'</div>
<div> [-Werror,-Wsign-conversion]</div><div> if (channel->events() & ~(got))</div><div> ^~~~~~~~~~~~~~~~~ ~</div><div>/home/ubuntu/claire/claire-common/claire/common/eventloop/poller/EPollPoller.cc:132:41: error: implicit conversion changes signedness: 'uint32_t' (aka 'unsigned int') to 'int'</div>
<div> [-Werror,-Wsign-conversion]</div><div> channel->set_revents(events_[i].events);</div><div> ~~~~~~~ ~~~~~~~~~~~^~~~~~</div><div>/home/ubuntu/claire/claire-common/claire/common/eventloop/poller/EPollPoller.cc:138:27: error: implicit conversion changes signedness: 'int' to 'size_type' (aka 'unsigned long')</div>
<div> [-Werror,-Wsign-conversion]</div><div> events_.resize(cnt*2);</div><div> ~~~~~~~ ~~~^~</div><div>/home/ubuntu/claire/claire-common/claire/common/eventloop/poller/EPollPoller.cc:143:73: error: implicit conversion changes signedness: 'const int' to 'size_type'</div>
<div> (aka 'unsigned long') [-Werror,-Wsign-conversion]</div><div> if (static_cast<size_t>((*it)) < channels_.size() && !channels_[*it].channel->IsNoneEvent())</div><div> ~~~~~~~~~ ^~~</div>
<div>/home/ubuntu/claire/claire-common/claire/common/eventloop/poller/EPollPoller.cc:145:42: error: implicit conversion changes signedness: 'const int' to 'size_type'</div><div> (aka 'unsigned long') [-Werror,-Wsign-conversion]</div>
<div> actives->push_back(channels_[*it].channel);</div><div> ~~~~~~~~~ ^~~</div></div><div><br></div></div>
<br>_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@cs.uiuc.edu" target="_blank">cfe-users@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a><br>
<br></blockquote></div><br></div></div>
</div></blockquote></div></div></div></blockquote></div><br></div></div>