[libc-commits] [PATCH] D77279: [libc] Add strlen implementation.

Paula Toth via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 1 20:09:37 PDT 2020


PaulkaToast added inline comments.


================
Comment at: libc/src/string/strlen.h:1
-//===-------------------- Implementation of strcpy -----------------------===//
+//===----------------- Implementation header for strlen -------------------===//
 //
----------------
abrachet wrote:
> We could add the `-*- C++ -*-`
Just noticed none of the headers in string have this.  I'll go make a separate patch for that. Thanks!


================
Comment at: libc/test/src/string/strlen_test.cpp:16
+  size_t result = __llvm_libc::strlen(empty);
+  ASSERT_EQ((size_t)0, result);
+}
----------------
abrachet wrote:
> Maybe `0UL` and `12UL` whichever you think looks better.
Ah, good point! I think I prefer the explicit cast because its very obvious what type it is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77279





More information about the libc-commits mailing list