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 2016/02/10 08:13:05 UTC

Review Request 43416: Windows: Removed ambiguous call to `::write`.

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

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


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Clemmer <cl...@gmail.com>.

> 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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Clemmer <cl...@gmail.com>.

> 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?

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.


- 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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Clemmer <cl...@gmail.com>.

> 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`.
> 
> Alex Clemmer wrote:
>     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.

I added a comment to the review for posterity.


- Alex


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


On Feb. 26, 2016, 9:23 p.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43416/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2016, 9:23 p.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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Michael Park <mp...@apache.org>.

> 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.

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`.


- Michael


-----------------------------------------------------------
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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Michael Park <mp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/#review120623
-----------------------------------------------------------


Fix it, then Ship it!





3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp (line 52)
<https://reviews.apache.org/r/43416/#comment182088>

    Why is the cast to `size_t` needed here?


- Michael Park


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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Naparu <al...@outlook.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/#review119935
-----------------------------------------------------------


Ship it!




Ship It!

- Alex Naparu


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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Michael Park <mp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/#review120999
-----------------------------------------------------------


Ship it!




Ship It!

- Michael Park


On Feb. 26, 2016, 9:23 p.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43416/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2016, 9:23 p.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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Clemmer <cl...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/
-----------------------------------------------------------

(Updated Feb. 26, 2016, 9:23 p.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 (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 88b355e09f76f0412c74ad69556572f0079deb8f 

Diff: https://reviews.apache.org/r/43416/diff/


Testing
-------


Thanks,

Alex Clemmer


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Clemmer <cl...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/
-----------------------------------------------------------

(Updated Feb. 26, 2016, 9:21 p.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 (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 88b355e09f76f0412c74ad69556572f0079deb8f 

Diff: https://reviews.apache.org/r/43416/diff/


Testing
-------


Thanks,

Alex Clemmer


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Alex Clemmer <cl...@gmail.com>.
-----------------------------------------------------------
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 (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 88b355e09f76f0412c74ad69556572f0079deb8f 

Diff: https://reviews.apache.org/r/43416/diff/


Testing
-------


Thanks,

Alex Clemmer


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by Yi Sun <yi...@hotmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/#review119098
-----------------------------------------------------------


Ship it!




Ship It!

- Yi Sun


On Feb. 10, 2016, 7:13 a.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43416/
> -----------------------------------------------------------
> 
> (Updated Feb. 10, 2016, 7:13 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
> 
>


Re: Review Request 43416: Windows: Removed ambiguous call to `::write`.

Posted by M Lawindi <ml...@microsoft.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43416/#review119091
-----------------------------------------------------------


Ship it!




Ship It!

- M Lawindi


On Feb. 10, 2016, 7:13 a.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43416/
> -----------------------------------------------------------
> 
> (Updated Feb. 10, 2016, 7:13 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
> 
>