[libc-commits] [PATCH] D71094: [libc] Add implementation of errno and define the other macros of errno.h.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Dec 5 23:47:32 PST 2019


sivachandra marked an inline comment as done.
sivachandra added inline comments.


================
Comment at: libc/spec/stdc.td:176
+      [
+        Macro<"errno">,
+      ],
----------------
sivachandra wrote:
> sivachandra wrote:
> > abrachet wrote:
> > > Are adding the errno macros out of the scope of this patch?
> > The generated header is not coming out pretty (though syntactically correct) with a large number of macros added (the order seems messed up ). I had wanted to first fix that up and then add the remaining macros. But, after reading your comment, it occurs to me that it is better to fix the problem than to hedge it. So, I have added the remaining macros now. Will improve the look of the generated file with a different patch.
> Also, I am not sure if a libc should provide these macros or if we should fallback to the ones provided by the Linux headers. Glibc seems to be preferring to use the Linux headers, while musl seems to be providing them itself. May be @stanshebs can throw some light here.
I took a closer look at the numbers used by musl. They are just a copy of the linux numbers. Also, ISTM that if Linux provides them, we should use them. Will discuss with @stanshebs and update the patch.


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