|
Boost : |
From: Maurizio Vitale (mav_at_[hidden])
Date: 2007-11-16 19:07:19
w.r.t boost HEAD and GCC 4.2.1
in function find_nothrow (line 298) the following fragment appear:
if (approximate_matches.size() > 1)
boost::throw_exception(
ambiguous_option(name, approximate_matches));
else
return found.get();
GCC issues a warning about control flow reaching the end of a non-void
function.
boost::throw_exception is visible to the compiler and it could
determine that it _always_ throws. But GCC doesn't.
For GCC (and probably the Intel compiler) it would be possible to
attach an __attribute__((noreturn)) to the declaration of throw_exception,
but this wouldn't be portable.
Would it be acceptable to return a fake pointer after the call to throw_exception?
We know we'd never get there and the warning would be turned off, a big plus
for those using boost in a local directory and insisting on compiling with
-Wall and -Werror.
Best regards,
Maurizio
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk