码迷,mamicode.com
首页 > 其他好文 > 详细

Git :消除Warning

时间:2015-05-12 00:10:57      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:git   linux   gcc   xshell   

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

标签:git   linux   gcc   xshell   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!