mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bannier" <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 40953: Avoid accepting hex float literals
Date Fri, 04 Dec 2015 23:13:40 GMT

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


No idea why this suddenly had to be so expedited, but here still my comments as I believe
that while this makes the test suite pass it is broken usagewise.


3rdparty/libprocess/3rdparty/stout/include/stout/numify.hpp (line 37)
<https://reviews.apache.org/r/40953/#comment168430>

    Just noticed that this fails to parse negative hex numbers like `-0x2`. This seems overly
restrictive to me.



3rdparty/libprocess/3rdparty/stout/include/stout/numify.hpp (line 38)
<https://reviews.apache.org/r/40953/#comment168429>

    Instead of this comment we should specify what *we* support (we are not writing a C++
lexer, but interpreting user input here).
    
    My expectation for this would be to support what e.g., a `stringstream` can parse with
`hex` or `hexfloat` (or `stoi`, `strtof`, ...).



3rdparty/libprocess/3rdparty/stout/tests/numify_tests.cpp (line 42)
<https://reviews.apache.org/r/40953/#comment168434>

    As currently implemented we should test that mixed float & exponent forms also fail,
e.g. `0xF.Ep-1`.
    
    I do not agree that being so limited is needed.
    
    Note that e.g., `strtof` would fail to parse `0x10.9` since it lacks the required exponent.


- Benjamin Bannier


On Dec. 4, 2015, 5:23 a.m., Cong Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40953/
> -----------------------------------------------------------
> 
> (Updated Dec. 4, 2015, 5:23 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Ben Mahler, Jie Yu, and Michael Park.
> 
> 
> Bugs: MESOS-4045
>     https://issues.apache.org/jira/browse/MESOS-4045
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> GCC, as an extension, accepts hex float literals even for C++, this is not allowed by
standard C++. So we disallow it explicitly.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/numify.hpp 2035653d578497e88ef465dc6cd49e2c0fc53366

>   3rdparty/libprocess/3rdparty/stout/tests/numify_tests.cpp 26fa7a4a06b36f9e7490e3274264f84b0369d412

> 
> Diff: https://reviews.apache.org/r/40953/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Cong Wang
> 
>


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