gabime / spdlog

Fast C++ logging library.
Other
24.34k stars 4.55k forks source link

Compiler warning with gcc-9 shipped with Fedora 30 #1077

Closed bsergean closed 5 years ago

bsergean commented 5 years ago

Here is the error.

/tmp/cmake/ws/../third_party/spdlog/include/spdlog/fmt/bundled/format.h:3475:55: warning: ISO C++ did not adopt string literal operator templates taking an argument pack of characters [-Wpedantic]
 3475 | FMT_CONSTEXPR internal::udl_formatter<Char, CHARS...> operator""_format() {
      |                                                       ^~~~~~~~

If someone has an idea I can help to validate the fix.

gabime commented 5 years ago

This is part of the fmtlib code. Seems it has already been reported here.

bsergean commented 5 years ago

Ah thanks for the link. It looks like they have fixed the problem so whenever you guys update fmtlib this should be fixed.

On May 15, 2019, at 4:37 PM, Gabi Melman notifications@github.com wrote:

This is part of the fmtlib code. Seems it has already been reported here https://github.com/fmtlib/fmt/issues/1148.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gabime/spdlog/issues/1077?email_source=notifications&email_token=AC2O6UMLOOBPVOFKLMA52XLPVSNEZA5CNFSM4HNGGAY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVQHWYY#issuecomment-492862307, or mute the thread https://github.com/notifications/unsubscribe-auth/AC2O6UN7X3FTBGBPREGZIHTPVSNEZANCNFSM4HNGGAYQ.

DennisOSRM commented 5 years ago

Ah thanks for the link. It looks like they have fixed the problem so whenever you guys update fmtlib this should be fixed.

@gabime Would it be possible to cut a new release s.t. other projects depending on it can upgrade?

gabime commented 5 years ago

This will have to wait for official fmt release - some time after june 17: https://github.com/fmtlib/fmt/issues/1160#issuecomment-492449920

limitedAtonement commented 5 years ago

Please update when that fmt release is ready and spdlog compiles again. In the meantime, I did:

diff --git a/include/spdlog/fmt/bundled/format.h b/include/spdlog/fmt/bundled/format.h
index 1bb24a5..a4dc1e1 100644
--- a/include/spdlog/fmt/bundled/format.h
+++ b/include/spdlog/fmt/bundled/format.h
@@ -126,7 +126,7 @@ FMT_END_NAMESPACE
       FMT_GCC_VERSION >= 407 || FMT_MSC_VER >= 1900) && \
       (!(FMT_ICC_VERSION || FMT_CUDA_VERSION) || \
        FMT_ICC_VERSION >= 1500 || FMT_CUDA_VERSION >= 700)
-#  define FMT_USE_USER_DEFINED_LITERALS 1
+#  define FMT_USE_USER_DEFINED_LITERALS 0
 # else
 #  define FMT_USE_USER_DEFINED_LITERALS 0
 # endif
I couldn't figure out a way to do this by setting #defines.