W8081 Void functions may not return a value (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

(Command-line option to suppress warning: -w-voi)

Your source file declared the current function as returning void, but the compiler encountered a return statement with a value. The value of the return statement will be ignored.

Example:

// This HAS to be in a "C" file.  In a "C++" file this would be an error

void foo()

{

        return 0;       // Can't return a value from a void function

}