Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Warning (level 1) C4508
Collapse the table of content
Expand the table of content

Compiler Warning (level 1) C4508

Error Message

'function' : function should return a value; 'void' return type assumed

The function has no return type specified. In this case, C4430 should also fire and the compiler implements the fix reported by C4430 (default value is int).

To resolve this warning, explicitly declare the return type of functions.

The following sample generates C4508:

// C4508.cpp
// compile with: /W1 /c
#pragma warning (disable : 4430)
func() {}   // C4508
void func2() {}   // OK

Community Additions

ADD
Show:
© 2015 Microsoft