warn_missingreturn

Controls whether the compiler generates a warning when a function that returns a value is missing a return statement.

Syntax

#pragma warn_missingreturn on | off | reset

Targets
All platforms.
Remarks

An example is shown in Listing 10.41.

Listing 10.41 Example of warn_missingreturn pragma

#pragma warn_missingreturn on

int foo()
{
// no return statement in foo()
} // generates a warning: return value expected

This pragma corresponds to the Missing ‘return’ Statements option . To check this setting, use __option (warn_missingreturn), described in Checking Settings. The default setting is off.