[libc-commits] [libc] [libc] Expand usage of libc null checks. (PR #116262)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Fri Feb 7 13:11:06 PST 2025


================
@@ -120,3 +121,12 @@ TEST(LlvmLibcMemChrTest, SignedCharacterFound) {
   // Should find the first character 'c'.
   ASSERT_EQ(actual[0], c);
 }
+
+#if defined(LIBC_TARGET_OS_IS_LINUX)
----------------
nickdesaulniers wrote:

I would use `defined` when I have an expression with multiple sub expressions. Because you have just 1 sub expression, prefer the form `#ifdef`.

example:
```c
#ifdef ONE
#if defined(ONE) && defined(TWO)
```

https://github.com/llvm/llvm-project/pull/116262


More information about the libc-commits mailing list