Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt 6.0.0 warnings under gcc-8.3.0 (+ CUDA nvcc) #1288

Closed
fbusato opened this issue Aug 29, 2019 · 3 comments
Closed

fmt 6.0.0 warnings under gcc-8.3.0 (+ CUDA nvcc) #1288

fbusato opened this issue Aug 29, 2019 · 3 comments

Comments

@fbusato
Copy link
Contributor

fbusato commented Aug 29, 2019

Hi,

A couple of warnings:

fmt/include/fmt/core.h(477): warning: attribute does not apply to any entity

fmt/include/fmt/core.h(478): warning: attribute does not apply to any entity

fmt/include/fmt/format.h(2599): warning: attribute does not apply to any entity

fmt/include/fmt/format.h(2600): warning: attribute does not apply to any entity

fmt/include/fmt/safe-duration-cast.h(193): warning: pointless comparison of unsigned integer with zero
          detected during:
            instantiation of "To fmt::v6::safe_duration_cast::safe_duration_cast<To,FromRep,FromPeriod,<unnamed>,<unnamed>>(std::chrono::duration<FromRep, FromPeriod>, int &) [with To=std::chrono::duration<fmt::v6::conditional_t<false, uint32_t, uint64_t>, std::ratio<1L, 1L>>, FromRep=fmt::v6::conditional_t<false, uint32_t, uint64_t>, FromPeriod=std::micro, <unnamed>=0, <unnamed>=0]"
fmt/include/fmt/chrono.h(447): here
            instantiation of "To fmt::v6::internal::fmt_safe_duration_cast<To,FromRep,FromPeriod>(std::chrono::duration<FromRep, FromPeriod>) [with To=std::chrono::duration<fmt::v6::conditional_t<false, uint32_t, uint64_t>, std::ratio<1L, 1L>>, FromRep=fmt::v6::conditional_t<false, uint32_t, uint64_t>, FromPeriod=std::micro]"
fmt/include/fmt/chrono.h(532): here
            instantiation of "fmt::v6::internal::chrono_formatter<FormatContext, OutputIt, Rep, Period>::chrono_formatter(FormatContext &, OutputIt, std::chrono::duration<Rep, Period>) [with FormatContext=fmt::v6::format_context, OutputIt=std::back_insert_iterator<fmt::v6::basic_memory_buffer<char, 500UL, std::allocator<char>>>, Rep=int64_t, Period=std::micro]"
include/fmt/chrono.h(818): here
            instantiation of "auto fmt::v6::formatter<std::chrono::duration<Rep, Period>, Char, void>::format(const fmt::v6::formatter<std::chrono::duration<Rep, Period>, Char, void>::duration &, FormatContext &)->decltype((<expression>)) [with Rep=int64_t, Period=std::micro, Char=char, FormatContext=fmt::v6::format_context]"
fmt/include/fmt/core.h(740): here
            instantiation of "void fmt::v6::internal::value<Context>::format_custom_arg<T,Formatter>(const void *, fmt::v6::basic_parse_context<fmt::v6::internal::value<Context>::char_type, fmt::v6::internal::error_handler> &, Context &) [with Context=fmt::v6::format_context, T=std::chrono::duration<int64_t, std::micro>, Formatter=fmt::v6::conditional_t<true, fmt::v6::formatter<std::chrono::duration<int64_t, std::micro>, char, void>, fmt::v6::internal::fallback_formatter<std::chrono::duration<int64_t, std::micro>, char, void>>]"
fmt/include/fmt/core.h(727): here
            instantiation of "fmt::v6::internal::value<Context>::value(const T &) [with Context=fmt::v6::format_context, T=std::chrono::duration<int64_t, std::micro>]"
fmt/include/fmt/core.h(1015): here
            instantiation of "fmt::v6::internal::value<Context> fmt::v6::internal::make_arg<IS_PACKED,Context,T,<unnamed>>(const T &) [with IS_PACKED=true, Context=fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char>>, char>, T=std::chrono::duration<int64_t, std::micro>, <unnamed>=0]"
fmt/include/fmt/core.h(1106): here
            instantiation of "fmt::v6::format_arg_store<Context, Args...>::format_arg_store(const Args &...) [with Context=fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char>>, char>, Args=<const char *, std::chrono::duration<int64_t, std::micro>>]"
fmt/include/fmt/core.h(1285): here
            instantiation of "fmt::v6::format_arg_store<fmt::v6::buffer_context<Char>, fmt::v6::remove_reference_t<Args>...> fmt::v6::internal::make_args_checked<Args...,S,Char>(const S &, const fmt::v6::remove_reference_t<Args> &...) [with Args=<const char *&, timer::microseconds &>, S=char [6], Char=char]"
fmt/include/fmt/core.h(1410): here
            instantiation of "void fmt::v6::print(const S &, Args &&...) [with S=char [6], Args=<const char *&, timer::microseconds &>, <unnamed>=0]"

fmt/include/fmt/safe-duration-cast.h(65): warning: pointless comparison of unsigned integer with zero
          detected during:
            instantiation of "To fmt::v6::safe_duration_cast::lossless_integral_conversion<To,From,<unnamed>>(From, int &) [with To=int64_t, From=unsigned long, <unnamed>=0]"
(206): here
            instantiation of "To fmt::v6::safe_duration_cast::safe_duration_cast<To,FromRep,FromPeriod,<unnamed>,<unnamed>>(std::chrono::duration<FromRep, FromPeriod>, int &) [with To=std::chrono::duration<int64_t, std::micro>, FromRep=fmt::v6::conditional_t<false, uint32_t, uint64_t>, FromPeriod=std::micro, <unnamed>=0, <unnamed>=0]"
fmt/include/fmt/chrono.h(447): here
            instantiation of "To fmt::v6::internal::fmt_safe_duration_cast<To,FromRep,FromPeriod>(std::chrono::duration<FromRep, FromPeriod>) [with To=std::chrono::duration<int64_t, std::micro>, FromRep=fmt::v6::conditional_t<false, uint32_t, uint64_t>, FromPeriod=std::micro]"
fmt/include/fmt/chrono.h(662): here
            instantiation of "void fmt::v6::internal::chrono_formatter<FormatContext, OutputIt, Rep, Period>::on_second(fmt::v6::internal::numeric_system) [with FormatContext=fmt::v6::format_context, OutputIt=std::back_insert_iterator<fmt::v6::basic_memory_buffer<char, 500UL, std::allocator<char>>>, Rep=int64_t, Period=std::micro]"
fmt/include/fmt/chrono.h(263): here
            instantiation of "const Char *fmt::v6::internal::parse_chrono_format(const Char *, const Char *, Handler &&) [with Char=char, Handler=fmt::v6::internal::chrono_formatter<fmt::v6::format_context, std::back_insert_iterator<fmt::v6::basic_memory_buffer<char, 500UL, std::allocator<char>>>, int64_t, std::micro> &]"
fmt/include/fmt/chrono.h(820): here
            [ 3 instantiation contexts not shown ]
            instantiation of "fmt::v6::internal::value<Context> fmt::v6::internal::make_arg<IS_PACKED,Context,T,<unnamed>>(const T &) [with IS_PACKED=true, Context=fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char>>, char>, T=std::chrono::duration<int64_t, std::micro>, <unnamed>=0]"
fmt/include/fmt/core.h(1106): here
            instantiation of "fmt::v6::format_arg_store<Context, Args...>::format_arg_store(const Args &...) [with Context=fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char>>, char>, Args=<const char *, std::chrono::duration<int64_t, std::micro>>]"
fmt/include/fmt/core.h(1285): here
            instantiation of "fmt::v6::format_arg_store<fmt::v6::buffer_context<Char>, fmt::v6::remove_reference_t<Args>...> fmt::v6::internal::make_args_checked<Args...,S,Char>(const S &, const fmt::v6::remove_reference_t<Args> &...) [with Args=<const char *&, timer::microseconds &>, S=char [6], Char=char]"
fmt/include/fmt/core.h(1410): here
            instantiation of "void fmt::v6::print(const S &, Args &&...) [with S=char [6], Args=<const char *&, timer::microseconds &>, <unnamed>=0]"
			
with timer::microseconds = std::chrono::microseconds
@fbusato
Copy link
Contributor Author

fbusato commented Aug 30, 2019

After a further investigation, I understand that happens only with nvcc (CUDA compiler).

a possible workaround for "warning: pointless comparison of unsigned integer with zero"
safe-duration-cast.h:65
if (std::is_signed<From>::value && from < 0) {

safe-duration-cast.h:193
if (std::is_signed<IntermediateRep>::value && count < min1) {

while for "warning: attribute does not apply to any entity"
core.h:125

#ifndef FMT_DEPRECATED
#  if defined(__NVCC__)      // <-- here
#    define FMT_DEPRECATED
#  elif (FMT_HAS_CPP_ATTRIBUTE(deprecated) && __cplusplus >= 201402L) || \
      FMT_MSC_VER >= 1900
#    define FMT_DEPRECATED [[deprecated]]
#  else
#    if defined(__GNUC__) || defined(__clang__)
#      define FMT_DEPRECATED __attribute__((deprecated))
#    elif FMT_MSC_VER
#      define FMT_DEPRECATED __declspec(deprecated)
#    else
#      define FMT_DEPRECATED /* deprecated */
#    endif
#  endif
#endif

@luncliff
Copy link
Contributor

Hi @fbusato. I saw the same error when I was dealing with #1285. BUT the issue was with MSVC.

Would you try agan with the latest master branch?

vitaut added a commit that referenced this issue Aug 31, 2019
vitaut added a commit that referenced this issue Aug 31, 2019
vitaut added a commit that referenced this issue Aug 31, 2019
@vitaut
Copy link
Contributor

vitaut commented Aug 31, 2019

The attribute issue have been worked around in #1285 and the remaining warnings should be fixed in 9a56a60.

@vitaut vitaut closed this as completed Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants