|ARM Technical Support Knowledge Articles|
Applies to: C166 C Compiler
I have C166 compiler v1.13. Why is it impossible to use return(0); in a function which is declared as:
void function_name (void)
The reason for the error/warning message is because a void function, by definition, does not return a value. When you include the return (0) statement, you are saying that the function returns a value of 0. This presents the compiler with a contradicting declaration and return. So, the compiler generates an error.
Use return; instead of return(0); to exit a void function.
Article last edited on: 2004-06-07 09:46:32
Did you find this article helpful? Yes No
How can we improve this article?