throw_error_already_set and compiler warnings

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

throw_error_already_set and compiler warnings

Johan Råde-2
The declaration

   BOOST_PYTHON_DECL void throw_error_already_set();

should maybe be changed to

   BOOST_PYTHON_DECL BOOST_ATTRIBUTE_NORETURN void
throw_error_already_set();

This will help eliminate warnings on some compilers,
and will save people the trouble of writing code like

   int f()
   {
     ...
     boost::python::throw_error_already_set();
     return 0; // unreachable but needed to silence compiler warning
   }

BOOST_ATTRIBUTE_NORETURN is defined in
boost/exception/detail/attribute_noreturn.hpp.

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig