[libc-commits] [PATCH] D75420: [libc] Add initial assert definition

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 4 11:47:55 PST 2020


sivachandra added inline comments.


================
Comment at: libc/config/linux/api.td:38
   let Defn = [{
     int *__errno_location();
     #define errno (*__errno_location())
----------------
I think `extern C` for c++ is missing here.


================
Comment at: libc/config/linux/api.td:45
+  let Macros = [
+    StaticAssertMacro,
+  ];
----------------
Why not the `assert` macro?


================
Comment at: libc/config/linux/api.td:48
+
+  let Functions = [
+    "__assert_fail",
----------------
Instead, we should define the assert macro as:

```
#ifdef __cplusplus
extern C
#endif
void __assert_fail(...); // Don't use size_t for arg types
#define assert ...
#endif
```


================
Comment at: libc/spec/stdc.td:29
+          FunctionSpec<
+              "__assert_fail",
+              RetValSpec<NoReturn>,
----------------
This is implementation detail so should not be listed here.


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

https://reviews.llvm.org/D75420





More information about the libc-commits mailing list