Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

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

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR44743
Status NEW
Importance P enhancement
Reported by Kunal Tyagi (kunal.tyagi@rakuten.com)
Reported on 2020-01-31 12:11:20 -0800
Last modified on 2020-01-31 13:16:11 -0800
Version trunk
Hardware All All
CC llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

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.

Quuxplusone 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