guodongxiaren opened a new pull request #1427:
URL: https://github.com/apache/incubator-brpc/pull/1427


   发现 #1381 这个PR被merge以后,还是有大量`no trivial copy-assignment; use 
value-initialization instead [-Wclass-memaccess]`的警告。
   比如:
   ```
   /home/guodong/github/guodong/incubator-brpc/src/butil/resource_pool.h:97:54: 
  required from ‘T* butil::get_resource(butil::ResourceId<T>*) [with T = 
bthread::TimerThread::Task]’
   
/home/guodong/github/guodong/incubator-brpc/src/bthread/timer_thread.cpp:187:43:
   required from here
   
/home/guodong/github/guodong/incubator-brpc/src/butil/resource_pool_inl.h:133:19:
 warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘class 
butil::atomic<butil::ResourcePool<bthread::TimerThread::Task>::Block*>’ with no 
trivial copy-assignment; use value-initialization instead [-Wclass-memaccess]
   
   133 |             memset(blocks, 0, sizeof(butil::atomic<Block*>) * 
RP_GROUP_NBLOCK);
   ```
   
   所以我参考 #1381 的修改思路(他参考的rapidjson的中的解决同样告警的PR Tencent/rapidjson#1323 
),将警告的其余各处全部修改了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to