warning: control reaches end of non-void function 和 warning: implicit declaration of function 'rsgClearColor' is invalid in C99
用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的更多相关文章
- warning: control reaches end of non-void function
用gcc编译一个程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一些 ...
- 【gcc】warning: control reaches end of non-void function
用gcc编译一个C程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一 ...
- bug_ warning: control reaches end of non-void function
摘要 在leetcode上编译时,它显示我编译错误 warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说 ...
- 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下的代码如下: ...
- 关于"implicit declaration of function 'gettimeofday' is invalid in c99"的解决
http://blog.csdn.net/macmini/article/details/10503799 当我们使用 gettimeofday(&time, NULL);时,会出现这样一个W ...
- implicit declaration of function 'copy_from_user'
内核中使用copy_from_user()和copy_to_user()函数,编译出现错误: implicit declaration of function 'copy_from_user' 需要添 ...
- Implicit declaration of function 'CC_MD5' is invalid in C99
//导入这个就行了#import <CommonCrypto/CommonDigest.h> //没有导包的时候,提示如下: Implicit declaration of functio ...
- implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99
问题:implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99 解决办法: 在出现该问题的函数前后加上 ...
- warning: implicit declaration of function 'getMyfilename' [-Wimplicit-function-declaration]|
我在main后面定义了getMyfilename()函数,然后就报出这个warning. 在main前声明一下就好了.
随机推荐
- spring boot 基础篇 -- 阿里多数据源
这块是比较基础的配置,阿里数据库配置还是比较好用的,并且可以用来监控数据源的情况.废话不多说,下面看代码. 基于maven项目,在pom.xml中添加引用: <dependency> &l ...
- //封装tabs函数
//封装tabs函数function tabs(tabTit,on,tabCon){ $(tabCon).each(function(){ $(this).children().eq(0).show( ...
- 《Effective C++》——条款04:确定对象使用前已先被初始化
读取未初始化的值会导致不明确的行为.在某些平台上,仅仅只是读取未初始化的值,就可能让你的程序终止运行.更可能的情况是读入一些“半随机”bits,污染了正在进行读取动作的那个对象,最终导致不可预知的程序 ...
- Servlet细节处理
1.Servlet的线程安全问题 尽管servlet的工作效率高,但是线程也是不安全的,因为一个类型的Servlet只有一个实例对象,那么就有可能会出现一个Servlet同时处理多个请求 解决方案:所 ...
- VueJs路由跳转——vue-router的使用
对于单页应用,官方提供了vue-router进行路由跳转的处理,本篇主要也是基于其官方文档写作而成. 安装 基于传统,我更喜欢采用npm包的形式进行安装. npm install vue-router ...
- 打印iphone支持的所有字体
//打印iphone支持的所有字体 NSArray *familyNames = [UIFont familyNames]; for(NSString *familyName in familyNam ...
- 浅谈FFT(快速傅里叶变换)
本文主要简单写写自己在算法竞赛中学习FFT的经历以及一些自己的理解和想法. FFT的介绍以及入门就不赘述了,网上有许多相关的资料,入门的话推荐这篇博客:FFT(最详细最通俗的入门手册),里面介绍得很详 ...
- leetcode_sql_1,176,177
1.176题目,Second Highest Salary,https://leetcode.com/problems/second-highest-salary/#/description Writ ...
- HDFS常用的Java Api详解
转自:http://blog.csdn.net/michaelwubo/article/details/50879832 一.使用Hadoop URL读取数据 package hadoop; impo ...
- arm linux 下移植busybox 的tftp
(1)进入busybox目录,make menuconfig ,然后在networking中勾选tftp项跟tftpd项. (2)配置/etc/inetd.conf 中关于tftp的选项(此部未验证, ...