Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2314276
  • 博文数量: 527
  • 博客积分: 10343
  • 博客等级: 上将
  • 技术积分: 5565
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-26 23:05
文章分类

全部博文(527)

文章存档

2014年(4)

2012年(13)

2011年(19)

2010年(91)

2009年(136)

2008年(142)

2007年(80)

2006年(29)

2005年(13)

我的朋友

分类: LINUX

2010-12-07 13:47:57

给定下面的C/C++ 语句, flexe-lint (9.00e) 会给出下面的错误判断:

    unsigned int heartbeat_count = (unsigned int)-1;
    bool cond_3 = (heartbeat_count+1==0 );

test.c  39  Warning 587: Predicate '==' can be pre-determined and always evaluates to False

显然, 如果heartbeat_count值为 (unsigned int)-1; 则与1相加结果为0.
阅读(1260) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~