Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of Xcode compiler flags

I know there are many compiler flags and how to use them. At times while seeing a third-party code we encounter a new flag and fail to understand why the hell this flag is used? How no warnings are shown even though there is retain-cycle in an existing code.

So I tried to find if I can find all the compiler flags with description. That would help to understand about its usage and other flags to replace it.

Please provide me some link or list of all the flags.

like image 774
Anoop Vaidya Avatar asked Sep 16 '25 07:09

Anoop Vaidya


1 Answers

The list of compiler flags I found it in Clang Compiler User Manual. This link may get broken some day but surely it will be there with the Compiler User Manaul.

Command Line Options

This section is generally an index into other sections. It does not go into depth on the ones that are covered by other sections. However, the first part introduces the language selection and other high level options like -c, -g, etc.

Options to Control Error and Warning Messages

-Werror Turn warnings into errors.

-Werror=foo

Turn warning “foo” into an error. -Wno-error=foo Turn warning “foo” into an warning even if -Werror is specified.

-Wfoo Enable warning “foo”.

-Wno-foo Disable warning “foo”.

-w Disable all diagnostics.

-Weverything Enable all diagnostics.

-pedantic Warn on language extensions.

-pedantic-errors

.....Continued

like image 183
Anoop Vaidya Avatar answered Sep 18 '25 01:09

Anoop Vaidya