mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Schwartzmeyer <and...@schwartzmeyer.com>
Subject Re: Review Request 64736: Fixed conversion warnings.
Date Tue, 09 Jan 2018 19:13:37 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64736/
-----------------------------------------------------------

(Updated Jan. 9, 2018, 11:13 a.m.)


Review request for mesos, Greg Mann, Jie Yu, Joseph Wu, and Michael Park.


Changes
-------

Rebased.


Repository: mesos


Description
-------

Fixed conversion warnings in `cram_md5` authentication. The potential
for overflow here is exceedingly unlikely, and we have been ignoring
these warnings to date without problem.

Fixed conversion warning in `files.cpp`. The signature accepts an
`off_t` type, but we calculated the offset from a `size_t`.

Fixed `size_t` to `int` warning in `default_executor.cpp`. The only use
of this counter is in `taskGroup.tasks().Get(index++)`, which expects an
`int`, so we changed the type.

Fixed conversion warnings in master. We can't change the return types
because the `Metric` class only accepts `double` types, so we
`static_cast` (as we were already doing elsewhere in the class).

Fixed warnings when converting to `pid_t` in the containerizer. Can't
change the arguments types because they're in the protocol, but they
obviously represent a `pid_t` originally, so this is a safe
`static_cast`.

Fixed warnings when constructing a `Seconds`a in `slave.cpp` as it takes
`int64_t`, but we're giving it a `double`. We can't change the `double`
because it's set in the protocol, and we're currently ignoring the
conversion anyway, so we just cast. We may want to provide a `double`
constructor for `Seconds` in the future that does proper rounding.

Fixed `size_t` to `int` conversion warning in `slave.cpp`. This counter
was only used in `usage->mutable_exedcutors(i++)` which expected an
`int`, so we changed the type.

Fixed conversion warnings in `zookeeper.cpp`. The signatures of these
functions take an `int`, and they're coming from a `size()`. We have
bigger problems if this overflows.


Diffs (updated)
-----

  src/authentication/cram_md5/authenticatee.cpp 7b3f767e29163de489018081089e67a6f22971c5 
  src/authentication/cram_md5/authenticator.cpp 2a12bb3f4aec79056ec6c82a8c896ee3af15bb4c 
  src/files/files.cpp ad2189b9f2b919eb2f70c738655fa6ecfaaa1b11 
  src/launcher/default_executor.cpp 6c88de413379d3b58f19a24ac0c2f43e38e85e54 
  src/master/master.hpp 130f6e28cc62a8912aac66ecfbf014fe1ee444e3 
  src/master/master.cpp 1610f4331225235e85f5a83e5338870cef99a5c8 
  src/master/registrar.cpp ffb4582086aa939ffe7ccf4ff1d52fb68a9ecb78 
  src/slave/containerizer/mesos/containerizer.cpp cddc6173d17c8bd2585899b154f976c3822dffdd

  src/slave/containerizer/mesos/isolators/posix.hpp caa282c95746e845992c971982892cf60c9b982c

  src/slave/containerizer/mesos/isolators/windows/cpu.cpp 6b376efa9ff88ff93ee3dc8441fae4cda109d55f

  src/slave/containerizer/mesos/isolators/windows/mem.cpp 64d11347d73328cb9665697b1ddd69a00276b51f

  src/slave/containerizer/mesos/launcher.cpp ec31fa24c8b91583b8b327a0c658ed6e87bd292f 
  src/slave/slave.cpp aeb0fdaeda78f26de2ec790735bfa88c5be72850 
  src/zookeeper/zookeeper.cpp 5ede4e5c47b30693ef9f296777dea8db2c4a48d8 


Diff: https://reviews.apache.org/r/64736/diff/3/

Changes: https://reviews.apache.org/r/64736/diff/2-3/


Testing
-------

These are in Mesos.

Excluding 3rdparty:

On Windows 10:

```
Build succeeded.
    0 Warning(s)
    0 Error(s)
```

On CentOS 7, with Autotools:

```
make check
```

Passed. Also apparently -Wsign-compare is on, but not for Windows. Might re-evaluate our Windows
warning level. I'd like to turn -Werror on, but all the compilers generate different sets
of warnings :(


Thanks,

Andrew Schwartzmeyer


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message