
6 Apr
2005
6 Apr
'05
9:36 a.m.
The code below works as expected when compiled with g++ 3.4 as:
$ g++ -I$HOME/boost/cvs -g -W -Wall -o static_test2 static_test2.cpp
but it also produces this warning:
static_test2.cpp: In static member function `static foo foo::set()': static_test2.cpp:15: warning: no return statement in function returning non-void
Clearly, I could add a spurious return statement after the assert, but isn't g++ being a little over eager here? Can the warning not be silenced by the library?
None: it would have to introduce a return statement to do so, and that would break so many things that I don't know where to begin. Remember that many uses of BOOST_STATIC_ASSERT do expect it to compile, and generate neither code not data. John.