[libc-commits] [PATCH] D84469: [libc] Adds implementation for memrchr.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jul 24 10:09:42 PDT 2020


sivachandra added a comment.

This is a GNU extension. So, you need to add entry to https://github.com/llvm/llvm-project/blob/master/libc/spec/gnu_ext.td and linux's `api.td`.



================
Comment at: libc/src/string/memrchr.cpp:18
+  const unsigned char ch = c;
+  while (n--) {
+    if (str[n] == ch)
----------------
For better readability, may be:

```
for (; n != 0; --n) {
  ...
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84469





More information about the libc-commits mailing list