arun11299 / cpp-jwt

JSON Web Token library for C++
MIT License
396 stars 111 forks source link

'str_to_type' has a non-throwing exception specification but can still throw #31

Closed ghost closed 6 years ago

ghost commented 6 years ago

I just saw this warning while building version 1.1.0 using Clang 7. Potentially serious issue, an exception would result in an immediate call to std::terminate

/home/kwos/.conan/data/cpp-jwt/1.1.0/nullptr/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/jwt/jwt.hpp:67:3: error: 'str_to_type' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions]
  throw std::runtime_error("Unknown token type");
  ^
/home/kwos/.conan/data/cpp-jwt/1.1.0/nullptr/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/jwt/jwt.hpp:61:18: note: function declared non-throwing here
inline enum type str_to_type(const jwt::string_view typ) noexcept
                 ^                                       ~~~~~~~~
1 error generated.
arun11299 commented 6 years ago

Thanks for reporting the issue. Fixed it.

ghost commented 6 years ago

Thanks for writing the library in the first place :)

On Sat, Sep 29, 2018 at 3:54 Arun Muralidharan notifications@github.com wrote:

Closed #31 https://github.com/arun11299/cpp-jwt/issues/31.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arun11299/cpp-jwt/issues/31#event-1874232135, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwjhV4schqN85n4ZduorNIZgKHvuQ5Jks5ufnBzgaJpZM4W8Cxe .