mec@hollerith:~/exp-43-redux$ cat vector-fill.cc // Copyright 2007, Google Inc. All rights reserved. // Author: mec@google.com (Michael Chastain) #include <vector> std::vector<int> my_vector (117); === mec@hollerith:~/exp-43-redux$ /home/mec/gcc-4.3-20070601/install/bin/g++ -Wall -S vector-fill.cc /home/mec/gcc-4.3-20070601/install/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/stl_vector.h: In member function 'int std::vector<_Tp, _Alloc>::_M_fill_initialize(size_t, const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]': /home/mec/gcc-4.3-20070601/install/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/stl_vector.h:832: warning: control reaches end of non-void function === This is from: http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/bits/stl_vector.h?r1=124243&r2=125223 Trivial lack of "void". === Also, shouldn't there also be an error about lack of return type for _M_fill_initialize?
*** This bug has been marked as a duplicate of 32233 ***
Just a note: > Also, shouldn't there also be an error about lack of return type for > _M_fill_initialize? Well, here's the code snippet from the function grokdeclarator in decl.c that deals with missing return types: if (type_was_error_mark_node) /* We've already issued an error, don't complain more. */; else if (in_system_header || flag_ms_extensions) /* Allow it, sigh. */; else if (pedantic || ! is_main) pedwarn ("ISO C++ forbids declaration of %qs with no type", name); else warning (OPT_Wreturn_type, "ISO C++ forbids declaration of %qs with no type", name); As you can see, return types may be omitted in system headers (probably because there were too many systems with such headers around). Otherwise you should get a diagnostic.