> On Feb. 25, 2016, 12:22 a.m., Michael Park wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp, line 52
> > <https://reviews.apache.org/r/43416/diff/2/?file=1253414#file1253414line52>
> >
> >     Why is the cast to `size_t` needed here?
> 
> Alex Clemmer wrote:
>     It is required, and (though it has been awhile) I believe it's because on 
> 64-bit machines, without this type information, 1 could be one of several 
> integral types. The cast disambiguates.
> 
> Michael Park wrote:
>     I only see one definition of `::write` in 
> `3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp`, which has the 
> signature: `inline auto write(int fd, const void* buffer, size_t count)`.
>     
>     Doesn't seem like there should be any ambiguity here, are there other 
> defintions of `write` that we're contending with? Because `1` is clearly 
> convertible to `size_t`.

There is also `::write` in the Windows implementation of the C Runtime. To 
confirm that this is the problem, we can delete the `inline auto write` you 
mention, and the compile problem disappears. (I just confirmed this is true.)

So, practically speaking, there seem to be two choices:

(1) Delete the `::write` in windows.hpp.
(2) Add a cast here.

Note that if we choose (1) we should probably then fork every file where where 
we call `::write` in the code, and replace those calls with `::_write`, as the 
former is deprecated.


- Alex


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


On Feb. 18, 2016, 12:59 a.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43416/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2016, 12:59 a.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Windows: Removed ambiguous call to `::write`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 
> 88b355e09f76f0412c74ad69556572f0079deb8f 
> 
> Diff: https://reviews.apache.org/r/43416/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>

Reply via email to