You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Alex Clemmer <cl...@gmail.com> on 2017/02/13 10:21:36 UTC
Review Request 56592: Libprocess: Removed MSVC compiler warnings.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56592/
-----------------------------------------------------------
Review request for mesos, Andrew Schwartzmeyer, Daniel Pravat, and Joseph Wu.
Repository: mesos
Description
-------
Libprocess: Removed MSVC compiler warnings.
Diffs
-----
3rdparty/libprocess/include/process/metrics/counter.hpp a13cc7e18c8b23eae83c326d63874d9d2aaedc0d
Diff: https://reviews.apache.org/r/56592/diff/
Testing
-------
Thanks,
Alex Clemmer
Re: Review Request 56592: Libprocess: Removed MSVC compiler warnings.
Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56592/#review165879
-----------------------------------------------------------
Fix it, then Ship it!
3rdparty/libprocess/include/process/network.hpp (line 50)
<https://reviews.apache.org/r/56592/#comment237712>
Note: This is a note, rather than an issue.
This is an implicit cast from `size_t` (usually uint64_t) to `socklen_t` (usually uint32_t). As a down-cast, we may sometimes want to check against `std::numeric_limits`, but in this case we don't need to.
`Address::size` is the amount of bytes a socket address struct requires. If we actually had a struct bigger than 4GB, there would be much more fundamental issues to solve :D
So this line LGTM.
3rdparty/libprocess/src/encoder.hpp (line 247)
<https://reviews.apache.org/r/56592/#comment237724>
For an unsigned -> signed (size_t -> off_t) cast, we need to check if `size < std::numeric_limits<off_t>::max()`.
I plan to add this to the constructor:
```
// NOTE: For files, we expect the size to be derived from `stat`-ing
// the file. The `struct stat` returns the size in `off_t` form,
// meaning that it is a programmer error to construct the `FileEncoder`
// with a size greater the max value of `off_t`.
CHECK_LE(_size, std::numeric_limits<off_t>::max());
```
- Joseph Wu
On Feb. 14, 2017, 12:58 a.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56592/
> -----------------------------------------------------------
>
> (Updated Feb. 14, 2017, 12:58 a.m.)
>
>
> Review request for mesos, Andrew Schwartzmeyer, Daniel Pravat, and Joseph Wu.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Libprocess: Removed MSVC compiler warnings.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/metrics/counter.hpp a13cc7e18c8b23eae83c326d63874d9d2aaedc0d
> 3rdparty/libprocess/include/process/network.hpp 0590e7a67275b9e37af2a49c050daab5eeaee7a5
> 3rdparty/libprocess/src/encoder.hpp b019bf90c0aabbce50d90f5ed6f3fd25d725e542
>
> Diff: https://reviews.apache.org/r/56592/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Alex Clemmer
>
>
Re: Review Request 56592: Libprocess: Removed MSVC compiler warnings.
Posted by Alex Clemmer <cl...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56592/
-----------------------------------------------------------
(Updated Feb. 14, 2017, 8:58 a.m.)
Review request for mesos, Andrew Schwartzmeyer, Daniel Pravat, and Joseph Wu.
Changes
-------
Removed more warnings.
Repository: mesos
Description
-------
Libprocess: Removed MSVC compiler warnings.
Diffs (updated)
-----
3rdparty/libprocess/include/process/metrics/counter.hpp a13cc7e18c8b23eae83c326d63874d9d2aaedc0d
3rdparty/libprocess/include/process/network.hpp 0590e7a67275b9e37af2a49c050daab5eeaee7a5
3rdparty/libprocess/src/encoder.hpp b019bf90c0aabbce50d90f5ed6f3fd25d725e542
Diff: https://reviews.apache.org/r/56592/diff/
Testing
-------
Thanks,
Alex Clemmer