关于warning: suggest parentheses around assignment used as truth value [-Wparentheses]|的解决方法
今天,在调试的时候一直出现warning: suggest parentheses around assignment used as truth value
代码如下:
if(startTime==0)
{
while(startTime=time((time_t*)NULL)==-1);
}
while(currentTime=time((time_t*)NULL)==-1);
timedif=currentTime-startTime;
if((strlen(cookie)<5)||(timedif>600))
{
startTime=currentTime;
command_login();//登录操作
}
改成像下面这样子就好了
if(startTime==0)
{
while((startTime=time((time_t*)NULL))==-1);
}
while((currentTime=time((time_t*)NULL))==-1);
timedif=currentTime-startTime;
if((strlen(cookie)<5)||(timedif>600))
{
startTime=currentTime;
command_login();//登录操作
}
如果在一个括号里面又进行判断,又进行赋值,赋值的语句应该放到一个单独的括号里面。
关于warning: suggest parentheses around assignment used as truth value [-Wparentheses]|的解决方法的更多相关文章
- warning: suggest parentheses around assignment used as truth value
编译时的警告如下:
- 安装完 swoole 后出现 PHP Warning: PHP Startup: Unable to load dynamic library 'swoole.so'的解决方法
安装完 swoole 后出现 PHP Warning: PHP Startup: Unable to load dynamic library 'swoole.so' (tried: /home/s ...
- PHP Warning: Module 'modulename' already loaded in Unknown on line 0 的解决方法
今天无间断服务加载php-fpm时,爆出了一个错误:PHP Warning: Module 'xhprof' already loaded in Unknown on line 0 <br / ...
- suggest parentheses around comparison in operand of &|
error discription: .:: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparen ...
- 16种C语言编译警告(Warning)类型的解决方法
当编译程序发现程序中某个地方有疑问,可能有问题时就会给出一个警告信息.警告信息可能意味着程序中隐含的大错误,也可能确实没有问题.对于警告的正确处理方式应该是:尽可能地消除之.对于编译程序给出的每个警告 ...
- 一些常见warning的原因和解决方法
在入职三周后,终于赶齐了接手项目落下两个月的项目,有了一些自己的空闲时间对项目进行整理.主要整理包括类目的整合,从原来一个系统文件夹下几百个文件整改为以MVC设计思想为原则的分文件夹整理类目,井然有序 ...
- PHP出现Warning: A non-numeric value encountered问题的原因及解决方法
本文介绍php出现Warning: A non-numeric value encountered问题,用实例分析出现这种错误的原因,并提供避免及解决问题的方法. <?php error_rep ...
- 【svn】SSL error: A TLS warning alert has been received的解决方法
第一次用svn(>_<),结果在运行下面语句时,svn很不友好的报错了..... svn co http:10.11.12.13/test1/test2 . 报错信息: svn: OPTI ...
- Centos 7 mysql Buffered warning: Changed limits: max_connections: 214 解决方法
Everytime I restart MySQL I have this warning: [Warning] Buffered warning: Changed limits: max_conne ...
随机推荐
- Angular ( 一 ) angular的安装
1. 全局安装angular 脚手架工具 npm install -g @angular/cli 2. 打开到创建目录: 3. 创建项目 ng new my-app 4. 打开项目 5. 安装依赖 n ...
- windows杀进程
netstat -aon|findstr 1099 tasklist|findstr 1008 taskkill /pid 10084 -f
- Java8-对map过滤
1.对map按值过滤返回值 public class TestMapFilter { public static void main(String[] args) { Map<Integer, ...
- vue - 列表显示(列互相影响,全选控制,更新数据)
要实现的效果为:全选,且列A列B互相影响,列B勾选则列A一定勾选,列A取消勾选,则相应列B取消勾选 数组 vue中列表渲染有些不是相应式的 var list=[ { a:'aaaa', b:'ddd' ...
- 使用littleTools简化docker/kubectl的命令
littleTools littleTools是我根据日常运维时编写的一个小工具,开源在了https://github.com/xuxinkun/littleTools上. littleTools包含 ...
- ojdbc包加入本地仓库
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar - ...
- zabbix报警逻辑初探
zabbix报警逻辑初探 首先贴出一张网上找的一张关于zabbix报警相关表结构及表关联逻辑图: actions表 actions表对应前端配置是动作(actions) action由conditio ...
- UVA1030 Image Is Everything
思路 如果两个面看到颜色不同,则这个正方体一定要被删掉 然后依次考虑每个面即可 注意坐标的映射 代码 #include <cstdio> #include <algorithm> ...
- 如何在Windows上的Jupyter Notebook中安装和运行PySpark
When I write PySpark code, I use Jupyter notebook to test my code before submitting a job on the clu ...
- RFS常见问题
一.DatabaseLibrary 库遇到的问题:1,连接mysql库,查询语句带有中文,报FAIL UnicodeEncodeError: 'latin-1' codec can't encode ...