用gcc编译一个程序的时候出现这样的警告:

warning: control reaches end of non-void function

它的意思是:控制到达非void函数的结尾。就是说你的一些本应带有返回值的函数到达结尾后可能并没有返回任何值。这时候,最好检查一下是否每个控制流都会有返回值。

《Android应用性能优化》 p202

hellorendering.rs 文件:

#pragma version(1)
#pragma rs java_package_name(com.lenovo.vcs.test1) //脚本实例创建时自动调用
void init(){
} int root(){
float red = rsRand(1.0f);
float green = rsRand(1.0f);
float blue = rsRand(1.0f); //清除随机颜色的背景色
rsgClearColor(red,green,blue,1.0f);    //出错误警告 warning: implicit declaration of function 'rsgClearColor' is invalid in C99 //每秒50帧 = 每帧20毫秒
return ;
}

后来发现是忘了包含头文件  #include "rs_graphics.rsh"

发现在Eclipse中。修改成功以后。错误还是会显示。Ctrl A->  Ctrl X-> Ctrl V之后

才不显示红叉号

warning: control reaches end of non-void function 和 warning: implicit declaration of function 'rsgClearColor' is invalid in C99的更多相关文章

  1. warning: control reaches end of non-void function

    用gcc编译一个程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一些 ...

  2. 【gcc】warning: control reaches end of non-void function

    用gcc编译一个C程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一 ...

  3. bug_ warning: control reaches end of non-void function

    摘要 在leetcode上编译时,它显示我编译错误 warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说 ...

  4. linux系统下,警告:warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 和 warning: the `gets' function is dangerous and should not be used. 的由来和解决方法。

    字符数组 的英文名字是 char [] gets()函数的基本用法为:char *gets(char *s); 该函数的参数是一个字符数组,该函数的返回值也是一个字符数组. linux下的代码如下: ...

  5. 关于"implicit declaration of function 'gettimeofday' is invalid in c99"的解决

    http://blog.csdn.net/macmini/article/details/10503799 当我们使用 gettimeofday(&time, NULL);时,会出现这样一个W ...

  6. implicit declaration of function 'copy_from_user'

    内核中使用copy_from_user()和copy_to_user()函数,编译出现错误: implicit declaration of function 'copy_from_user' 需要添 ...

  7. Implicit declaration of function 'CC_MD5' is invalid in C99

    //导入这个就行了#import <CommonCrypto/CommonDigest.h> //没有导包的时候,提示如下: Implicit declaration of functio ...

  8. implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99

    问题:implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99 解决办法: 在出现该问题的函数前后加上 ...

  9. warning: implicit declaration of function 'getMyfilename' [-Wimplicit-function-declaration]|

    我在main后面定义了getMyfilename()函数,然后就报出这个warning. 在main前声明一下就好了.

随机推荐

  1. jQuery download file

    jQuery.download = function (url, method, p, c, e, i, o, goodsType, reciveUser, suplier) { jQuery('&l ...

  2. [非原创] 常用加密算法整理 AES/SSL(一)

    前言: 在伟大的计算机科学家研究下,发明了许多的加密算法,以下做个简答的描述: 一.分类 加密算法分为两种:单向加密.双向加密. 单向加密,不可逆的加密算法,只能加密不能解密: 双向加密,由对称性加密 ...

  3. mysql 关联关系

    一 单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY field LIMIT 限制条数 二 关键 ...

  4. LeetCode OJ:Triangle(三角形)

    Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent n ...

  5. 《Effective C++》——条款08:别让异常逃离析构函数

    考虑如下代码: class Widget{ public: ... ~Widget(){...}//假设这个可能吐出一个异常 }; void doSomething() { std::vector&l ...

  6. Nhibernate系列学习之(四) 数据操作

    数据操作,在这里主要介绍INSERT.UPDATE.DELETE.我们在使用NHibernate的时候,如果只是查询数据,不需要改变数据库的值,那么是不需要提交或者回滚到数据库的. 一.INSERT ...

  7. Codeforces Round #258 (Div. 2)C(暴力枚举)

    就枚举四种情况,哪种能行就是yes了.很简单,关键是写法,我写的又丑又长...看了zhanyl的写法顿时心生敬佩.写的干净利落,简直美如画...这是功力的体现! 以下是zhanyl的写法,转载在此以供 ...

  8. hawq创建filespace,tablespace,database,table

    使用HAWQ   在HAWQ的使用上跟Greenplum基本就一样一样的了.比如:   1. 创建表空间 #选创建filespace,生成配置文件 [gpadmin@master ~]$ hawq f ...

  9. docker+jenkins 部署持续集成环境

    1.使用docker container的方式安装jenkins [root@hadoop default]# docker pull jenkin 创建一个目录用于后边映射 [root@hadoop ...

  10. 重温CLR(一)CLR基础

    如果一个C#developer,对CLR没有了解,那就只能是入门级别.未来.NET CORE是趋势,但是.NET CORE 也是基于CoreCLR的,而CLR和CoreCLR其实差别不大,从runti ...