Hi all,
Two warnings on my bots I’m not sure what you all prefer to do about:
- warning: ‘break’ will never be executed [-Wunreachable-code-break]
case itk::ImageIOBase::DOUBLE:
std::cerr << "Hashing is not supporting for float and double images." << std::endl;
itkGenericExceptionMacro( "Hashing is not supported for images of float or doubles." );
break; // <- warning here
case itk::ImageIOBase::UNKNOWNCOMPONENTTYPE:
default:
assert( false ); // should never get here unless we forgot a type
itkGenericExceptionMacro( "Logic error!" );
Do you prefer we remove the break, or I disable this warning flag? It’s the only such warning in all of ITK currently, but I concede it’s maybe not the most useful warning ever.
- warning: assigning field to itself [-Wself-assign-field]
/** Concept requiring T to have operator =. (BOOST) */
template< typename T >
struct Assignable {
struct Constraints {
void constraints()
{
a = a; // <- warning here
const_constraints(a);
}
I’ve often seen “a = a” as a way to silence unused variable warnings, but this doesn’t look like that…
Cheers,
Sean