Re: [RFC PATCH 0/1] compiler_types.h: introduce ASSUME_NONNULL macro for static analysis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 25, 2025 at 1:19 PM Mulyadi Santosa
<mulyadi.santosa@xxxxxxxxx> wrote:
> Interesting idea. Other than silencing clang analyzer warning, what is exactly the advantage of using such macro?

Well there are three main advantages that I saw:
- Clarity to readers that the pointer is guaranteed to be non-null,
and that a check is redundant (because performance critical context,
etc.)
- Future patches that decide to use this macro can be a signal to
reviewers to actually check correctness that a pointer is indeed
invariably non-null
- Make static analysis more useful by documenting when a certain false
positive is actually false

I also wondered if it could reduce the possibility and volume of AI
generated patches from just running analyzers on the kernel to reduce
noise.

I was also planning to create a heuristic tool to check a patch if a
code change could affect a path using this macro and break the
assertion.

Raka

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux