Suppress warning about missing noreturn attribute

Adding `[[noreturn]]` to `report_unknown_type` suppresses the Clang/GCC `-Wmissing-noreturn` warning:

Clang outputs:

    .../fmt/fmt/format.cc:294:74: warning:
          function 'report_unknown_type' could be declared with
          attribute 'noreturn' [-Wmissing-noreturn]
      ...code, const char *type) {
                                 ^

GCC outputs:

    .../fmt/fmt/format.cc:294:74: warning: function might be candidate for
        attribute 'noreturn' [-Wsuggest-attribute=noreturn]
      ...code, const char *type) {
                                 ^
This commit is contained in:
Mário Feroldi 2017-07-20 16:13:24 -03:00 committed by GitHub
parent 9c56a8ce5c
commit ca13eee19f

View File

@ -923,7 +923,11 @@ struct IntTraits {
TypeSelector<std::numeric_limits<T>::digits <= 32>::Type MainType;
};
#if FMT_HAS_GXX_CXX11
FMT_API [[noreturn]] void report_unknown_type(char code, const char *type);
#else
FMT_API void report_unknown_type(char code, const char *type);
#endif
// Static data is placed in this class template to allow header-only
// configuration.