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

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Dec 18 13:59:19 PST 2024


nickdesaulniers wrote:

> but it causes linking errors.

What's the error you observe?  The precommit bot is pointing out:

```
/home/runner/work/llvm-project/llvm-project/libc/src/stdio/fscanf.cpp:25:3: error: variable has incomplete type 'volatile ::FILE' (aka 'volatile FILE')
   25 |   LIBC_CRASH_ON_NULLPTR(stream);
      |   ^
/home/runner/work/llvm-project/llvm-project/libc/src/__support/macros/null_check.h:23:38: note: expanded from macro 'LIBC_CRASH_ON_NULLPTR'
   23 |       [[maybe_unused]] volatile auto crash = *crashing;                        \
      |                                      ^
/home/runner/work/llvm-project/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
   12 | typedef struct FILE FILE;
      |                ^
```
which isn't a linkage failure.


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


More information about the libc-commits mailing list