[libc-commits] [libc] [libc] Expand usage of libc null checks. (PR #116262)
Aly ElAshram via libc-commits
libc-commits at lists.llvm.org
Sat May 31 14:02:11 PDT 2025
================
@@ -9,11 +9,14 @@
#include "src/string/memrchr.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/__support/macros/null_check.h"
#include <stddef.h>
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(void *, memrchr, (const void *src, int c, size_t n)) {
+ LIBC_CRASH_ON_NULLPTR(src);
----------------
AlyElashram wrote:
These functions are not mentioned in this doc [here](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf) , but they are different variants of the same function.
memrchr for example , is a variant of memchr and memchr is mentioned in the doc.
I'm not sure if we should include the variants or follow the document strictly @lntue .
https://github.com/llvm/llvm-project/pull/116262
More information about the libc-commits
mailing list