mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akash Gupta <akash-gu...@hotmail.com>
Subject Re: Review Request 67465: Windows: Log a fatal error if `WindowsFD(int)` is incorrectly used.
Date Fri, 08 Jun 2018 20:58:24 GMT

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


Ship it!




Ship It!

- Akash Gupta


On June 7, 2018, 9:59 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67465/
> -----------------------------------------------------------
> 
> (Updated June 7, 2018, 9:59 p.m.)
> 
> 
> Review request for mesos, Akash Gupta and Joseph Wu.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This constructor _should_ be `explicit` as the other constructors are;
> however, for historical reasons it is implicit in order to support the
> semantics of assigning from `-1, 0, 1, 2`. Unfortunately, its
> implicitness leads to subtle bugs. For instance, the code `int_fd s =
> ::socket(...)` on Windows compiles, but behaves incorrectly because
> the RHS `SOCKET` type is implicitly converted to an `int` to satisfy
> the only available implicit constructor, since the `WindowsFD(SOCKET)`
> constructor is marked `explicit`. As we should never construct off any
> of these values, but cannot constrain it at compile-time, we should
> add a fatal runtime error instead.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/os/windows/fd.hpp 5dbdff2680370d123579c5e3fdd9b0e0adaf512e

> 
> 
> Diff: https://reviews.apache.org/r/67465/diff/2/
> 
> 
> Testing
> -------
> 
> Still building, but this is what I propose. This is better than subtle sad panda bugs.
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


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