[libc-commits] [PATCH] D71094: [libc] Add implementation of errno.

Fangrui Song via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Dec 5 17:57:15 PST 2019


MaskRay requested changes to this revision.
MaskRay added inline comments.
This revision now requires changes to proceed.


================
Comment at: libc/config/linux/api.td:33
+  let Defn = [{
+    extern int *__errno_location();
+    #define errno *__errno_location()
----------------
abrachet wrote:
> We don't use `extern` for other function definitions in other header files so I don't think we should here
You need `__attribute__((const))` in `__GNUC__` mode, otherwise common subexpression elimination does not apply: think `errno+errno`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71094





More information about the libc-commits mailing list