[PATCH] D38132: [Support] mapped_file_region: avoid tautological comparison.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 07:36:31 PDT 2017


lebedev.ri added a comment.

On Thu, Sep 21, 2017 at 5:25 PM, Zachary Turner <zturner at google.com> wrote:

> No, I just fail. I somehow thought the check was against the Offset
>  parameter.
> 
> Is changing the function to take a size_t an option?

We certainly could do that. But then, if `size_t` is *not* as large as `uint64_t`,
when someone passes `uint64_t` value into the constructor, it will be either
silently truncated, or there will only be a compile-time warning about truncation...
I'd say that is worse than this preprocessor magic?


Repository:
  rL LLVM

https://reviews.llvm.org/D38132





More information about the llvm-commits mailing list