[libc-commits] [PATCH] D82724: [libc] Add memchr implementation.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 7 08:51:58 PDT 2020


sivachandra accepted this revision.
sivachandra marked an inline comment as done.
sivachandra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/config/linux/x86_64/entrypoints.txt:30
     libc.src.string.strcmp
+    libc.src.string.memchr
 
----------------
Add it to the aarch64 list as well?


================
Comment at: libc/src/string/CMakeLists.txt:54
+  DEPENDS
+    libc.include.string
+)
----------------
Do we need this dependency?


================
Comment at: libc/test/src/string/memchr_test.cpp:32
+  ASSERT_EQ(ret[0], 'b');
+  ASSERT_EQ(ret[1], 'c');
+}
----------------
cgyurgyik wrote:
> sivachandra wrote:
> > Ditto.
> Since src is not null-terminated, ASSERT_STREQ is going to look beyond the end of the array. I could add a null terminator to the end of ret, but don't know if that's much better than this approach. Is there an approach you were thinking of?
Acknowledged.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82724





More information about the libc-commits mailing list