You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Dominic Hamon <dh...@twopensource.com> on 2014/05/21 18:24:49 UTC

Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

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

Review request for mesos, Till Toenshoff and Vinod Kone.


Repository: mesos-git


Description
-------

see summary

Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.


Diffs
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 

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


Testing
-------

able to build on clang 3.4


Thanks,

Dominic Hamon


Re: Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/21777/#review43772
-----------------------------------------------------------

Ship it!


I've committed this, I'll let benh follow up if there's a cleaner solution that would be preferred.

- Ben Mahler


On May 21, 2014, 6:37 p.m., Dominic Hamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21777/
> -----------------------------------------------------------
> 
> (Updated May 21, 2014, 6:37 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> see summary
> 
> Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 
> 
> Diff: https://reviews.apache.org/r/21777/diff/
> 
> 
> Testing
> -------
> 
> able to build on clang 3.4
> 
> 
> Thanks,
> 
> Dominic Hamon
> 
>


Re: Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

Posted by Dominic Hamon <dh...@twopensource.com>.

> On May 22, 2014, 10:51 a.m., Timothy Chen wrote:
> > Can we merge this? This is blocking building for anyone using Mac.

also clang on linux.


- Dominic


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


On May 21, 2014, 11:37 a.m., Dominic Hamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21777/
> -----------------------------------------------------------
> 
> (Updated May 21, 2014, 11:37 a.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> see summary
> 
> Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 
> 
> Diff: https://reviews.apache.org/r/21777/diff/
> 
> 
> Testing
> -------
> 
> able to build on clang 3.4
> 
> 
> Thanks,
> 
> Dominic Hamon
> 
>


Re: Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

Posted by Timothy Chen <tn...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/21777/#review43736
-----------------------------------------------------------


Can we merge this? This is blocking building for anyone using Mac.

- Timothy Chen


On May 21, 2014, 6:37 p.m., Dominic Hamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21777/
> -----------------------------------------------------------
> 
> (Updated May 21, 2014, 6:37 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> see summary
> 
> Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 
> 
> Diff: https://reviews.apache.org/r/21777/diff/
> 
> 
> Testing
> -------
> 
> able to build on clang 3.4
> 
> 
> Thanks,
> 
> Dominic Hamon
> 
>


Re: Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

Posted by Dominic Hamon <dh...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/21777/
-----------------------------------------------------------

(Updated May 21, 2014, 6:37 p.m.)


Review request for mesos and Benjamin Hindman.


Changes
-------

assigning to @benjaminhindman to shepherd -- vinod


Repository: mesos-git


Description
-------

see summary

Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.


Diffs
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 

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


Testing
-------

able to build on clang 3.4


Thanks,

Dominic Hamon


Re: Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

Posted by Dominic Hamon <dh...@twopensource.com>.

> On May 21, 2014, 10:22 a.m., Vinod Kone wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp, line 678
> > <https://reviews.apache.org/r/21777/diff/1/?file=586696#file586696line678>
> >
> >     What is the exact warning that you are seeing in clang 3.4? Does it fail compilation?
> >     
> >     Also, would it be better to overload the copy constructor of Result for Unreachable?

This keeps the fix localised without risking any unexpected knock-ons for the rest of the code.


|| In file included from ../../../../3rdparty/libprocess/3rdparty/stout/tests/os/signals_tests.cpp:8:
3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp|677 col 10| error: conversion from 'Unreachable' to 'Result<uid_t>' is ambiguous
||   return UNREACHABLE();
||          ^~~~~~~~~~~~~
3rdparty/libprocess/3rdparty/stout/include/stout/unreachable.hpp|19 col 23| note: expanded from macro 'UNREACHABLE'
|| #define UNREACHABLE() Unreachable(__FILE__, __LINE__)
||                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp|51 col 3| note: candidate constructor [with U = Unreachable]
||   Result(const U& u)
||   ^
3rdparty/libprocess/3rdparty/stout/include/stout/unreachable.hpp|27 col 3| note: candidate function [with T = Result<unsigned int>]
||   operator T () const


- Dominic


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


On May 21, 2014, 9:24 a.m., Dominic Hamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21777/
> -----------------------------------------------------------
> 
> (Updated May 21, 2014, 9:24 a.m.)
> 
> 
> Review request for mesos, Till Toenshoff and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> see summary
> 
> Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 
> 
> Diff: https://reviews.apache.org/r/21777/diff/
> 
> 
> Testing
> -------
> 
> able to build on clang 3.4
> 
> 
> Thanks,
> 
> Dominic Hamon
> 
>


Re: Review Request 21777: Explicit conversion to Result<> from Unreachable to squash compiler error.

Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/21777/#review43637
-----------------------------------------------------------



3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
<https://reviews.apache.org/r/21777/#comment77916>

    What is the exact warning that you are seeing in clang 3.4? Does it fail compilation?
    
    Also, would it be better to overload the copy constructor of Result for Unreachable?


- Vinod Kone


On May 21, 2014, 4:24 p.m., Dominic Hamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21777/
> -----------------------------------------------------------
> 
> (Updated May 21, 2014, 4:24 p.m.)
> 
> 
> Review request for mesos, Till Toenshoff and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> see summary
> 
> Without the explicit conversion some compilers find the conversion from Unreachable() to Result<T>() ambiguous.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 94d8b4c7fcf83946e2f9dd0f3e746889599ca174 
> 
> Diff: https://reviews.apache.org/r/21777/diff/
> 
> 
> Testing
> -------
> 
> able to build on clang 3.4
> 
> 
> Thanks,
> 
> Dominic Hamon
> 
>