首页 > 其他 > 详细

Git :消除Warning

时间:2015-05-12 00:08:41      阅读:289      评论:0      收藏:0      [点我收藏+]

1:warning: comparison between signed and unsigned integer expressions

解决方法:强制类型转换 前面都加上(int),进行强制类型转换

技术分享

   if (key == NULL || (int)strlen(key) >(int)I_LIMITED_SIMPLE || strlen(key) < 1)
   // if (key == NULL || strlen(key) > I_LIMITED_SIMPLE || strlen(key) < 1)


2: warning:  ‘unsigned int sdk_req::m_nBufferLength’

技术分享

添加语句

#define UNUSED_VAR     __attribute__ ((unused))

for any variable just use the above macro before its type for example:

UNUSED_VAR int a = 2;
如:在原来变量前面添加UNUSED_VAR,即可
static const char*              V_REQUEST_STATE_END =           "END";
static const char*              V_REQUEST_STATE_DOING =         "DOING";
UNUSED_VAR static const char*           V_REQUEST_STATE_IDLE =          "IDLE";
UNUSED_VAR static const char*           V_REQUEST_STATE_RELEASE =       "RELEASE";


UNUSED_VAR static const char*           V_REQUEST_CONNECT_KEEP =        "Keep-Alive";
UNUSED_VAR static const char*           V_REQUEST_CONNECT_CLOSE =       "Close";


3: warning: suggest parentheses around assignment used as truth value

技术分享

解决方法:在if判断语句中添加个()


 if ((tmpLen = atoi(m_reqHttpRequest.GetHttpHeader(H_CONTENT_LENGTH).c_str())) > 0)
   // if (tmpLen = atoi(m_reqHttpRequest.GetHttpHeader(H_CONTENT_LENGTH).c_str()) > 0)




Git :消除Warning

原文:http://blog.csdn.net/lanjiangzhou/article/details/45649501

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!