用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. 一次应用js文件时遇到的怪异现象

    使用thinkphp开发的网页中, 应用js文件 <script  language="JavaScript"  src="__JS__/printer/jquer ...

  2. The import javax.servlet.jsp.JspWriter cannot be resolved' error

    Add servlet-api.jar and jsp-api.jar from Tomcat 6.0 library to ecipse project.

  3. 重写ddt的mk_test_name方法

    一. 测试用例名字的问题 使用ddt做测试,得到的测试报告中,测试用例的名字默认以_01, _02, _03...递增的形式结尾,这时我希望用例名能够以_api_name结尾,比如注册模块,希望看到的 ...

  4. 解决:easygui.msgbox("Hello there!")报错:Tcl_Init error: Can't find a usable init.tcl in the following directories问题的解决

    今天学习<父与子的编程之旅>,当看到运行第一个gui时(代码如下): import easygui easygui.msgbox("Hello there!") 发现报 ...

  5. Mac终端ls显示文件名为彩色

    原理: ls -G 可显示彩色文件名. 在终端输入: nano ~/.bash_profile 辑器.bash_profile文件,粘贴下面内容: alias cls='tput reset' ali ...

  6. JProfiler连接weblogic

    转 http://blog.csdn.net/xu1314/article/details/7737236

  7. linux monitor and maintanence

    @cacti 1.install epel extends source 2.install lamp use yum method yum install -y httpd php php-mysq ...

  8. hdu-2544-最短路(Bellman-Ford算法模板)

    题目链接 题意很清晰,入门级题目,适合各种模板,可用dijkstra, floyd, Bellman-ford, spfa Dijkstra链接 Floyd链接 Bellman-Ford链接 SPFA ...

  9. github提交代码时遇到”Everything up-to-date“问题的解决方式

    需要创建一个新分支,将最新代码加入新分支, 再将新分支合并到主分支,然后提交主分支代码到github网站. ---------------------------------------------- ...

  10. scrapy入门实践1

    Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 可以应用在包括数据挖掘,信息处理或存储历史数据等一系列的程序中. 这就是整个Scrapy的架构图了: 各部件职能: Scrapy ...