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

log: fix build on osx #18213

Merged
merged 1 commit into from
Oct 11, 2017
Merged

log: fix build on osx #18213

merged 1 commit into from
Oct 11, 2017

Commits on Oct 10, 2017

  1. log: fix build on osx

    we can not assume that the the `rep` type is identical to `time_t` and
    `susecond_t`, on osx they are `int`, not `int64_t`. so cast they as
    necessary.
    
    this fixes the error and warning of
    
    LogClock.h:112:7: error: non-constant-expression cannot be narrowed from type 'rep' (aka 'long long') to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]
                 std::chrono::duration_cast<std::chrono::microseconds>(
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kefu/dev/ceph/src/log/LogClock.h:112:7: note: insert an explicit cast to silence this issue
                 std::chrono::duration_cast<std::chrono::microseconds>(
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogClock.h:139:46: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
                          bdt.tm_hour, bdt.tm_min, bdt.tm_sec, tv.tv_usec / 1000);
                                                               ^~~~~~~~~~~~~~~~~
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>
    tchaikov committed Oct 10, 2017
    Configuration menu
    Copy the full SHA
    f29d304 View commit details
    Browse the repository at this point in the history