Warning:control reaches end of non-void function and warning:implicit declaration of function ' Rsgclearcolor ' is invalid I N C99

Source: Internet
Author: User

This warning appears when you compile a program with GCC:

Warning:control reaches end of non-void function

It means: control reaches the end of a non-void function. That means some of your functions that should have a return value may not return any value after the end of the function. At this point, it's a good idea to check if each control flow has a return value.

"Android App performance optimization" p202

Hellorendering.rs file:

#pragmaVersion (1)#pragmaRS Java_package_name (Com.lenovo.vcs.test1)//automatically called when a script instance is createdvoidinit () {}introot () {floatRed = Rsrand (1.0f); floatGreen = Rsrand (1.0f); floatBlue = Rsrand (1.0f); //clear the background color of random colorsRsgclearcolor (Red,green,blue,1.0f); Error warning WARNING:IMPLICIT declaration of function ' Rsgclearcolor ' is invalid in C99//50 frames per second = 20 milliseconds per frame    return  -;}

Later found to have forgotten to include the header file #include "Rs_graphics.rsh"

Found in Eclipse. After the modification succeeds. The error will still be displayed. CTRL a-> CTRL X-> CTRL V

It's not showing the Red Cross,

Warning:control reaches end of non-void function and warning:implicit declaration of function ' Rsgclearcolor ' is invalid I N C99

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.