编译出现如下错误

error: control may reach end of non-void function [-Werror,-Wreturn-type]

这个错误可能和编译器有关(在相同代码情况有的编译器可能不会报错,而有的可能会报错),也可能是因为函数没有返回值导致,比如:下面这个函数,如果输入参数a < b 就会导致函数没有返回值。

int fun(int a, int b){
if(a > b) return a;
}

error: control may reach end of non-void function [-Werror,-Wreturn-type]的更多相关文章

  1. implicitly declaring function 'malloc' with type void *(unsigned long ) 错误 解决

    errror :   implicitly declaring function 'malloc' with type void *(unsigned long ) Be sure to includ ...

  2. Error: [ng:areq] Argument 'xxxx' is not a function, got undefined

    "Error: [ng:areq] Argument 'keywords' is not a function, got undefined" 代码类似这样的: <div n ...

  3. Error 1313: RETURN is only allowed in a FUNCTION SQL Statement

    1.错误描述 14:07:26 Apply changes to rand_string Error 1313: RETURN is only allowed in a FUNCTION SQL St ...

  4. Error: [ng:areq] Argument ‘AppCtrl’ is not a function, got undefined

    今天把用ionic做一个案例,和ionic示例项目差不多,只是用requirejs分离了controller,但是一直报错 Error: [ng:areq] Argument ‘AppCtrl’ is ...

  5. VS2015 MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4

    今天在VS2015中用编译好的QT5静态库打包软件,配置好QT的静态环境后, 发现报MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved ...

  6. error C2556: 'const char &MyString::operator [](int)' : overloaded function differs only by return type from 'char &MyString::operator [](int)'

    char & operator[](int i);const char & operator[](int i);/*const char & operator(int i);* ...

  7. 错误提示”void is an invalid type for the variable“

    今晚做android作业,出现错误提示:void is an invalid type for the variable, invalid:无效的  variable:变量,在网上找了一下后知道是 方 ...

  8. ERROR 3077 (HY000): To have multiple channels, repository cannot be of type FILE; Please check the repository configuration and convert them to TABLE.

    在5.7.16搭建多源复制时,出现如下错误:   mysql> change master to master_host='192.168.56.156',master_user='repl', ...

  9. [Angular2 Animation] Control Undefined Angular 2 States with void State

    Each trigger starts with an “undefined” state or a “void” state which doesn’t match any of your curr ...

随机推荐

  1. solt插槽的使用。

    在组件内template中使用 <slot name='header'></slot> 在页面内 直接添加标签 如 <hs><h1 slot='header' ...

  2. TFS2018 linux Agent的安装

    1. 感谢徐蕾老师的文档,根据文档简单学会了TFS agent的安装,在此简单记录一下: 前置条件: CentOS7.4 or CentOS7.5的版本 安装的软件有git 2.17 dotnet s ...

  3. 解决Ubuntu中vi命令的编辑模式下不能正常使用方向键和退格键的问题

    在Ubuntu中,进入vi命令的编辑模式,发现按方向键不能移动光标,而是会输出ABCD,以及退格键也不能正常删除字符.这是由于Ubuntu预装的是vim-tiny,而我们需要使用vim-full,解决 ...

  4. 【Java】 异常

    异常分类 所有的异常都是由Throwable继承而来,但在下一层理解分解为两个类Error和Exception. Error类层次结构描述了Java运行时系统的内部错误和资源耗尽错误.应用程序不应该跑 ...

  5. codeforces445A

    DZY Loves Chessboard CodeForces - 445A DZY 喜欢棋盘,他很享受棋盘上的游戏. 他有一个 n 行和 m 列的棋盘.棋盘上的某些单元格是坏的位置,其他的是好的位置 ...

  6. python深浅copy探究

    引入 在python程序中,如果我们操作一个变量的值去做运算,而又想在下次调用时,仍使用原来的变量的值去做运算,那么我们我们就需要将这个变量去做备份,这就是本文所要探究的问题. 开始 变量-对象-引用 ...

  7. Django-website 程序案例系列-1 最简单的web服务器

    templates:html模板文件夹下面建立文件login.html <!DOCTYPE html> <html lang="en"> <head& ...

  8. Uva101-STL模拟

    一道有点复杂的STL模拟题,对STL迭代器不太熟悉改了好久,最后总算A了出来. 感觉用数组更方便...但是为了练习STL嘛 对比白书上的代码,我写的还是傻了点.一开始没有理解四个操作的意思,单纯的模拟 ...

  9. 【BZOJ1799】[AHOI2009]同类分布(动态规划)

    [BZOJ1799][AHOI2009]同类分布(动态规划) 题面 BZOJ 洛谷 题解 很容易想到数位\(dp\),然而数字和整除原数似乎不好记录.没关系,直接枚举数字和就好了,这样子就可以把整除原 ...

  10. CDQ分治学习笔记

    数据结构中的一块内容:$CDQ$分治算法. $CDQ$显然是一个人的名字,陈丹琪(NOI2008金牌女选手) 这种离线分治算法被算法界称为"cdq分治" 我们知道,一个动态的问题一 ...