From: SourceForge.net <no...@so...> - 2003-09-26 23:42:06
|
Bugs item #813284, was opened at 2003-09-27 08:59 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=813284&group_id=2435 Category: gcc Group: None >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Marcelo Taube (marcelouy) Assigned to: Danny Smith (dannysmith) Summary: not returning in nonvoid functions Initial Comment: Should the compiler check whatever a nonvoid function is returning or not? I think it should be checked. Because a small mistake (forgetting to write "return something" which is accepted currently by the compiler), may lead to an impossible-to-be-tracked-down bug. I show the problem in a very very small programm that always crashes. ***************CODE*************** #include <deque> #include <string> using namespace std; deque<string> func1() { } int main(int argc, char *argv[]) { func1(); return 0; } ***************END_OF_CODE*************** ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2003-09-27 11:41 Message: Logged In: YES user_id=11494 Just add -Wall to get that (and most other) warnings. Use gcc -v --help to get a list of the warnings that you can ask for. Dann ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=813284&group_id=2435 |