JustinStitt wrote:

A good example of a Linux kernel contributor running into an overflow that 
should really have its type marked as wrapping : 
https://lore.kernel.org/all/zrzk8hiladaj+...@gmail.com/

They could use this feature to mark the suspected field 
`percpu_ref->percpu_ref_data->count` as wrapping:

```c
struct percpu_ref_data {
        atomic_long_t           count __attribute__((wraps));
        ...
};

// or mark the type `atomic_long_t` as wrapping
typedef atomic_t __attribute__((wraps)) atomic_long_t;
```

Reviewers, can I get a sense of where we are at with this feature? It lets 
developers better express the behavior of arithmetic in their code.

https://github.com/llvm/llvm-project/pull/86618
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to