llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.15k stars 12.03k forks source link

Unable to check if a flag is warning or compile option #44088

Open llvmbot opened 4 years ago

llvmbot commented 4 years ago
Bugzilla Link 44743
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @zygoloid

Extended Description

GCC provides a --help=warning option that lists all warnings which don't affect compilation. There is no such option in clang, and the clang --help isn't machine consumable (for a good reason).

An option to query for warn flags and compile options separately would be nice. It'd be amazing if the warn flag option also worked like GCC (aka listed flags that aren't provided to clang) to see which options are not in use.

ec04fc15-fa35-46f2-80e1-5d271f2ef708 commented 4 years ago

Seems like a reasonable request.

In the mean time, you can use "diagtool list-warnings" for this (but 'diagtool' is not meant for redistribution, so you'll typically need to build it yourself), or you can consult http://clang.llvm.org/docs/DiagnosticsReference.html