[libc-commits] [PATCH] D91551: Initial commit of mktime.

Jeff Bailey via Phabricator via libc-commits libc-commits at lists.llvm.org
Sun Nov 22 16:52:21 PST 2020


jeffbailey added inline comments.


================
Comment at: libc/src/time/mktime.cpp:64
+      return (time_t)(-1);
+  }
+
----------------
rtenneti wrote:
> sivachandra wrote:
> > Could we do this overflow check in a more general fashion? For example, we can find a `maxYears` that can fit in `TIME_T_MAX` (I am making up `TIME_T_MAX`). After that, assuming valid inputs for other fields, we can progressively check if the result will fit in `time_t`.
> Add a TODO to investigate the above idea.
Is the TODO still necessary with the creation of outOfRange() that sets errno and returns -1?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91551/new/

https://reviews.llvm.org/D91551



More information about the libc-commits mailing list