I don’t think the check is even useful in any form.  The win32 api can handle 64 bit inputs for size and offset — always.  The size of the argument to the llvm function is irrelevant <br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 25, 2017 at 8:55 AM Reid Kleckner via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">rnk added inline comments.<br>
<br>
<br>
================<br>
Comment at: llvm/lib/Support/Windows/Path.inc:726<br>
-  if (Size > std::numeric_limits<SIZE_T>::max())<br>
-    return make_error_code(errc::invalid_argument);<br>
-<br>
----------------<br>
amccarth wrote:<br>
> I assume someone was originally worried that `SIZE_T` would be 32 bits wide in a 32-bit build but somehow believed `std::size_t` (which is the type of Size) could still somehow be larger than that.  Ain't gonna happen.<br>
I wonder if we should turn these examples of dynamic range checks into static_asserts. We saw a lot of these tautological comparison warnings in Chrome, where it was much less obvious that the types are the same size. Would this be an appropriate replacement for the check?<br>
  static_assert(std::numeric_limits<decltype(Size)>::max() <=<br>
                std::numeric_limits<SIZE_T>::max());<br>
<br>
<br>
<a href="https://reviews.llvm.org/D39263" rel="noreferrer" target="_blank">https://reviews.llvm.org/D39263</a><br>
<br>
<br>
<br>
</blockquote></div>