[flang-commits] [flang] [flang][OpenMP] Silence unused-but-set-variable message (NFC) (PR #130979)

via flang-commits flang-commits at lists.llvm.org
Fri Mar 14 03:28:08 PDT 2025


jeanPerier wrote:

> Note: the canonical way to [silence unused warnings](https://llvm.org/docs/CodingStandards.html#assert-liberally) is
> 
> ```c
> (void)symRef;
> ```

Is it? I am reading `When casting to void to suppress warnings about unused variables (as an alternative to [[maybe_unused]]). Prefer C-style casts in this instance.` as saying `[[maybe_unused]]` is also OK.

What is wrong with using this C++17 standard feature?

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


More information about the flang-commits mailing list