RAD Studio |  |

W8081: Void functions may not return a value (C++)
Example
Collapse All

(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
Copy Code

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

Copy Code

    void foo()

Copy Code

    {

Copy Code

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

Copy Code

    }

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!