Thursday, 15 July 2010

c++ - How to force compiler error when no value is explicitly returned from function -



c++ - How to force compiler error when no value is explicitly returned from function -

one of mutual errors create forget homecoming result method/function, , compiler doesn't complain.

how can create gcc raise compilation error if no result returned? (these trivial situations, there no homecoming statement in method)

use -wreturn-type (i recommend @ to the lowest degree -wall, maybe -wextra). gives warning when don't homecoming value; can utilize -werror create error.

c++ gcc

No comments:

Post a Comment