[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 13:25:05 PDT 2024


haoNoQ wrote:

`-Wunsafe-buffer-usage` is theoretically possible to use in C but it involves a lot of `#pragma clang unsafe_buffer_usage` to annotate and encapsulate every unsafe buffer operation. So it's impractical but we aren't disabling it because that'd be an unnecessary restriction and it won't be possible for the user to enable it back if we do that. And if we turn it into a separate warning flag, it won't really eliminate the problem for users who enable `-Weverything`.

Which is kind of the point of `-Weverything`. Configurations that pass `-Weverything` can never truly be supported. If you use `-Weverything` then every new warning implemented in clang will potentially annoy you. `-Weverything` is intended for discovering new warnings to enable explicitly. It's not designed for keeping it turned on on a permanent basis.

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


More information about the cfe-commits mailing list