How to check a warning is really enabled with zig cc?

gcc have -Q --help=warnings. but zig cc says “error: Unknown Clang option: ‘–help=warnings’”

Hello @ywx2012,

The list of warnings is: Diagnostic flags in Clang

Welcome to ziggit :slight_smile:

with gcc -Q -Wall -Wextra --help=warnings, it is easy to see if a warning flag is enabled or not.

The following options control compiler warning messages:
  --all-warnings              		-Wall
  --extra-warnings            		-Wextra
  -W                          		-Wextra
  -WNSObject-attribute        		[enabled]
  -Wabi                       		[disabled]
  -Wabi-tag                   		[available in C++, ObjC++]
  -Wabi=                      		
  -Wabsolute-value            		[enabled]
  -Waddress                   		[enabled]
  -Waddress-of-packed-member  		[enabled]

I just learned that clang has a seperate command called diagtool, but zig does not come with that.