lamyj / odil

Odil is a C++11 library for the DICOM standard
Other
85 stars 21 forks source link

warning: throw will always call terminate #69

Closed ferdymercury closed 4 years ago

ferdymercury commented 4 years ago

There is a compilation warning:

/opt/odil/src/odil/dcmtk/Exception.cpp: In member function ‘virtual const char* odil::dcmtk::Exception::what() const’:
/opt/odil/src/odil/dcmtk/Exception.cpp:58:50: warning: throw will always call terminate() [-Wterminate]
         throw std::runtime_error("Invalid source");
ferdymercury commented 4 years ago

I guess, it could be fixed by either removing the 'noexcept' keyword, or by doing instead return "Invalid source";

lamyj commented 4 years ago

Good catch, thank you. Fixed in 492f07c.