OptionsOn gcc itself
--analyzer-output
Static analyzer report output format <value>
--analyze
Run the static analyzer
-arcmt-migrate-emit-errors
Emit ARC errors even if the migrator can fix them
-arcmt-migrate-report-output
Output path for the plist report <value>
-B
Add <dir> to search path for binaries and object files used implicitly <dir>
-CC
Include comments from within macros in preprocessed output
-cl-denorms-are-zero
OpenCL only. Allow denormals to be flushed to zero
-cl-fast-relaxed-math
OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__
-cl-finite-math-only
OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf
-cl-fp32-correctly-rounded-divide-sqrt
OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded
-cl-kernel-arg-info
OpenCL only. Generate kernel argument metadata
-cl-mad-enable
OpenCL only. Allow use of less precise MAD computations in the generated binary
-cl-no-signed-zeros
OpenCL only. Allow use of less precise no signed zeros computations in the generated binary
-cl-opt-disable
OpenCL only. This option disables all optimizations. By default optimizations are enabled
-cl-single-precision-constant
OpenCL only. Treat double precision floating-point constant as single precision constant
-cl-std
OpenCL language standard to compile for <value>
-cl-strict-aliasing
OpenCL only. This option is added for compatibility with OpenCL 1.0
-cl-uniform-work-group-size
OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
-cl-unsafe-math-optimizations
OpenCL only. Allow unsafe floating-point optimizations
--config
Specifies configuration file <value>
--cuda-compile-host-device
Compile CUDA code for both host and device (default)
--cuda-device-only
Compile CUDA code for device only
--cuda-host-only
Compile CUDA code for host only
--cuda-include-ptx
Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once <value>
--cuda-noopt-device-debug
Enable device-side debug info generation. Disables ptxas optimizations
--cuda-path-ignore-env
Ignore environment variables to detect CUDA installation
--cuda-path
CUDA installation path <value>
-cxx-isystem
Add directory to the C++ SYSTEM include search path <directory>
-C
Include comments in preprocessed output
-c
Only run preprocess, compile, and assemble steps
-dD
Print macro definitions in -E mode in addition to normal output
-dependency-dot
Filename to write DOT-formatted header dependencies to <value>
-dependency-file
Filename (or -) to write dependency output to <value>
-dI
Print include directives in -E mode in addition to normal output
-dM
Print macro definitions in -E mode instead of normal output
-D
Define <macro> to <value> (or 1 if <value> omitted) <macro>=<value>
-emit-ast
Emit Clang AST files for source inputs
-emit-interface-stubs
Generate Interface Stub Files
-emit-llvm
Use the LLVM representation for assembler and object files
-emit-merged-ifs
Generate Interface Stub Files, emit merged text not binary
--emit-static-lib
Enable linker job to emit a static library
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark
-E
Only run the preprocessor
-fAAPCSBitfieldLoad
Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only)
-faddrsig
Emit an address-significance table
-faligned-allocation
Enable C++17 aligned allocation functions
-fallow-editor-placeholders
Treat editor placeholders as valid source code
-fansi-escape-codes
Use ANSI escape codes for diagnostics
-fapinotes-cache-path
Does nothing; API notes are no longer cached separately from modules <directory>
-fapinotes-modules
Enable module-based external API notes support
-fapinotes-swift-version
Specify the Swift version to use when filtering API notes <version>
-fapinotes
Enable external API notes support
-fapple-kext
Use Apple's kernel extensions ABI
-fapple-link-rtlib
Force linking the clang builtins runtime library
-fapple-pragma-pack
Enable Apple gcc-compatible #pragma pack handling
-fapplication-extension
Restrict
-fbasic-block-sections
Place each function's basic blocks in unique sections (ELF Only) : all | labels | none | list=<file> <value>
-fblocks
Enable the 'blocks' language feature
-fborland-extensions
Accept non-standard constructs supported by the Borland compiler
-fbranch-target-identification
Emit branch target identification instructions for indirect branch destinations
-fbuild-session-file
Use the last modification time of <file> as the build session timestamp <file>
-fbuild-session-timestamp
Time when the current build session started <time since Epoch in seconds>
-fbuiltin-module-map
Load the clang builtins module map file
-fcall-saved-x10
Make the x10 register call-saved (AArch64 only)
-fcall-saved-x11
Make the x11 register call-saved (AArch64 only)
-fcall-saved-x12
Make the x12 register call-saved (AArch64 only)
-fcall-saved-x13
Make the x13 register call-saved (AArch64 only)
-fcall-saved-x14
Make the x14 register call-saved (AArch64 only)
-fcall-saved-x15
Make the x15 register call-saved (AArch64 only)
-fcall-saved-x18
Make the x18 register call-saved (AArch64 only)
-fcall-saved-x8
Make the x8 register call-saved (AArch64 only)
-fcall-saved-x9
Make the x9 register call-saved (AArch64 only)
-fcf-protection
Enable cf-protection in 'full' mode <value>
-fchar8_t
Enable C++ builtin type char8_t
-fclang-abi-compat
Attempt to match the ABI of Clang <version> <version>
-fcolor-diagnostics
Enable colors in diagnostics
-fcomment-block-commands
Treat each comma separated argument in <arg> as a documentation comment block command <arg>
-fcommon
Place uninitialized global variables in a common block
-fcomplete-member-pointers
Require member pointer base types to be complete if they would be significant under the Microsoft ABI
-fconvergent-functions
Assume functions may be convergent
-fcoroutines-ts
Enable support for the C++ Coroutines TS
-fcoverage-mapping
Generate coverage mapping to enable code coverage analysis
-fcs-profile-generate
Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var) <directory>
-fcuda-approx-transcendentals
Use approximate transcendental functions
-fcuda-flush-denormals-to-zero
Flush denormal floating point values to zero in CUDA device mode
-fcuda-short-ptr
Use 32-bit pointers for accessing const/local/shared address spaces
-fcxx-exceptions
Enable C++ exceptions
-fdata-sections
Place each data in its own section
-fdebug-compilation-dir
The compilation directory to embed in the debug info <value>
-fdebug-default-version
Default DWARF version to use, if a -g option caused DWARF debug info to be produced <value>
-fdebug-info-for-profiling
Emit extra debug info to make sample profile more accurate
-fdebug-macro
Emit macro debug information
-fdebug-prefix-map
Remap file source paths in debug info <value>
-fdebug-ranges-base-address
Use DWARF base address selection entries in .debug_ranges
-fdebug-types-section
Place debug types in their own section (ELF Only)
-fdeclspec
Allow __declspec as a keyword
-fdelayed-template-parsing
Parse templated function definitions at the end of the translation unit
-fdelete-null-pointer-checks
Treat usage of null pointers as undefined behavior (default)
-fdiagnostics-absolute-paths
Print absolute paths in diagnostics
-fdiagnostics-hotness-threshold
Prevent optimization remarks from being output if they do not have at least this profile count <number>
-fdiagnostics-parseable-fixits
Print fix-its in machine parseable form
-fdiagnostics-print-source-range-info
Print source range spans in numeric form
-fdiagnostics-show-hotness
Enable profile hotness information in diagnostic line
-fdiagnostics-show-note-include-stack
Display include stacks for diagnostic notes
-fdiagnostics-show-option
Print option name with mappable diagnostics
-fdiagnostics-show-template-tree
Print a template comparison tree for differing templates
-fdigraphs
Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
-fdiscard-value-names
Discard value names in LLVM IR
-fdollars-in-identifiers
Allow '$' in identifiers
-fdouble-square-bracket-attributes
Enable '[[]]' attributes in all C and C++ language modes
-fdwarf-exceptions
Use DWARF style exceptions
-fembed-bitcode-marker
Embed placeholder LLVM IR data as a marker
-fembed-bitcode
Embed LLVM bitcode (option: off, all, bitcode, marker) <option>
-femit-all-decls
Emit all declarations, even if unused
-femulated-tls
Use emutls functions to access thread_local variables
-fenable-globaldse
Enable experimental global dead store elimination
-fenable-matrix
Enable matrix data type and related builtin functions
-fexceptions
Enable support for exception handling
-fexperimental-new-constant-interpreter
Enable the experimental new constant interpreter
-fexperimental-new-pass-manager
Enables an experimental new pass manager in LLVM
-fexperimental-relative-c++-abi-vtables
Use the experimental C++ class ABI for classes with virtual tables
-fexperimental-strict-floating-point
Enables experimental strict floating point in LLVM
-ffast-math
Allow aggressive, lossy floating-point optimizations
-ffile-prefix-map
Remap file source paths in debug info and predefined preprocessor macros <value>
-ffine-grained-bitfield-accesses
Use separate accesses for consecutive bitfield runs with legal widths and alignments
-ffixed-point
Enable fixed point types
-ffixed-r19
Reserve register r19 (Hexagon only)
-ffixed-r9
Reserve the r9 register (ARM only)
-ffixed-x10
Reserve the x10 register (AArch64/RISC-V only)
-ffixed-x11
Reserve the x11 register (AArch64/RISC-V only)
-ffixed-x12
Reserve the x12 register (AArch64/RISC-V only)
-ffixed-x13
Reserve the x13 register (AArch64/RISC-V only)
-ffixed-x14
Reserve the x14 register (AArch64/RISC-V only)
-ffixed-x15
Reserve the x15 register (AArch64/RISC-V only)
-ffixed-x16
Reserve the x16 register (AArch64/RISC-V only)
-ffixed-x17
Reserve the x17 register (AArch64/RISC-V only)
-ffixed-x18
Reserve the x18 register (AArch64/RISC-V only)
-ffixed-x19
Reserve the x19 register (AArch64/RISC-V only)
-ffixed-x1
Reserve the x1 register (AArch64/RISC-V only)
-ffixed-x20
Reserve the x20 register (AArch64/RISC-V only)
-ffixed-x21
Reserve the x21 register (AArch64/RISC-V only)
-ffixed-x22
Reserve the x22 register (AArch64/RISC-V only)
-ffixed-x23
Reserve the x23 register (AArch64/RISC-V only)
-ffixed-x24
Reserve the x24 register (AArch64/RISC-V only)
-ffixed-x25
Reserve the x25 register (AArch64/RISC-V only)
-ffixed-x26
Reserve the x26 register (AArch64/RISC-V only)
-ffixed-x27
Reserve the x27 register (AArch64/RISC-V only)
-ffixed-x28
Reserve the x28 register (AArch64/RISC-V only)
-ffixed-x29
Reserve the x29 register (AArch64/RISC-V only)
-ffixed-x2
Reserve the x2 register (AArch64/RISC-V only)
-ffixed-x30
Reserve the x30 register (AArch64/RISC-V only)
-ffixed-x31
Reserve the x31 register (AArch64/RISC-V only)
-ffixed-x3
Reserve the x3 register (AArch64/RISC-V only)
-ffixed-x4
Reserve the x4 register (AArch64/RISC-V only)
-ffixed-x5
Reserve the x5 register (AArch64/RISC-V only)
-ffixed-x6
Reserve the x6 register (AArch64/RISC-V only)
-ffixed-x7
Reserve the x7 register (AArch64/RISC-V only)
-ffixed-x8
Reserve the x8 register (AArch64/RISC-V only)
-ffixed-x9
Reserve the x9 register (AArch64/RISC-V only)
-fforce-dwarf-frame
Always emit a debug frame section
-fforce-emit-vtables
Emits more virtual tables to improve devirtualization
-fforce-enable-int128
Enable support for int128_t type
-ffp-contract
Form fused FP ops (e.g. FMAs): fast (everywhere) | on (according to FP_CONTRACT pragma) | off (never fuse). Default is 'fast' for CUDA/HIP and 'on' otherwise <value>
-ffp-exception-behavior
Specifies the exception behavior of floating-point operations <value>
-ffp-model
Controls the semantics of floating-point calculations <value>
-ffreestanding
Assert that the compilation takes place in a freestanding environment
-ffunction-sections
Place each function in its own section
-fglobal-isel
Enables the global instruction selector
-fgnu-keywords
Allow GNU-extension keywords regardless of language standard
-fgnu-runtime
Generate output compatible with the standard GNU Objective-C runtime
-fgnu89-inline
Use the gnu89 inline semantics
-fgnuc-version
Sets various macros to claim compatibility with the given GCC version <value>
-fgpu-allow-device-init
Allow
-fgpu-rdc
Generate relocatable device code, also known as separate compilation mode
-fhip-new-launch-api
Use new kernel launching API for HIP
-fignore-exceptions
Enable support for ignoring exception handling constructs
-fimplicit-module-maps
Implicitly search the file system for module map files
-finline-functions
Inline suitable functions
-finline-hint-functions
Inline
-finstrument-function-entry-bare
Instrument function entry only, after inlining, without arguments to the instrumentation call
-finstrument-functions-after-inlining
Like -finstrument-functions, but insert the calls after inlining
-finstrument-functions
Generate calls to instrument function entry and exit
-fintegrated-as
Enable the integrated assembler
-fintegrated-cc1
Run cc1 in-process
-fjump-tables
Use jump tables for lowering switches
-fkeep-static-consts
Keep static const variables if unused
-flax-vector-conversions
Enable implicit vector bit-casts <value>
-flto-jobs
Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected) <value>
-flto
Set LTO mode to either 'full' or 'thin' <value>
-fmacro-prefix-map
Remap file source paths in predefined preprocessor macros <value>
-fmath-errno
Require math functions to indicate errors by setting errno
-fmax-tokens
Max total number of preprocessed tokens for -Wmax-tokens <value>
-fmax-type-align
Specify the maximum alignment to enforce on pointers lacking an explicit alignment <value>
-fmerge-all-constants
Allow merging of constants
-fmessage-length
Format message diagnostics so that they fit within N columns <value>
-fmodule-file
Specify the mapping of module name to precompiled module file, or load a module file if name is omitted <<name>
-fmodule-map-file
Load this module map file <file>
-fmodule-name
Specify the name of the module to build <name>
-fmodules-cache-path
Specify the module cache path <directory>
-fmodules-decluse
Require declaration of modules used within a module
-fmodules-disable-diagnostic-validation
Disable validation of the diagnostic options when loading the module
-fmodules-ignore-macro
Ignore the definition of the given macro when building and loading modules <value>
-fmodules-prune-after
Specify the interval (in seconds) after which a module file will be considered unused <seconds>
-fmodules-prune-interval
Specify the interval (in seconds) between attempts to prune the module cache <seconds>
-fmodules-search-all
Search even non-imported modules to resolve references
-fmodules-strict-decluse
Like -fmodules-decluse but requires all headers to be in modules
-fmodules-ts
Enable support for the C++ Modules TS
-fmodules-user-build-path
Specify the module user build path <directory>
-fmodules-validate-input-files-content
Validate PCM input files based on content if mtime differs
-fmodules-validate-once-per-build-session
Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
-fmodules-validate-system-headers
Validate the system headers that a module depends on when loading the module
-fmodules
Enable the 'modules' language feature
-fms-compatibility-version
Dot-separated value representing the Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default)) <value>
-fms-compatibility
Enable full Microsoft Visual C++ compatibility
-fms-extensions
Accept some non-standard constructs supported by the Microsoft compiler
-fmsc-version
Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default)) <value>
-fnew-alignment
Specifies the largest alignment guaranteed by '::operator new(size_t)' <align>
-fno-addrsig
Don't emit an address-significance table
-fno-allow-editor-placeholders
-fno-apinotes-modules
Disable module-based external API notes support
-fno-apinotes
Disable external API notes support
-fno-assume-sane-operator-new
Don't assume that C++'s global operator new can't alias any pointer
-fno-autolink
Disable generation of linker directives for automatic library linking
-fno-builtin
Disable implicit builtin knowledge of functions <value>
-fno-c++-static-destructors
Disable C++ static destructor registration
-fno-char8_t
Disable C++ builtin type char8_t
-fno-color-diagnostics
Disable colors in diagnostics
-fno-common
Compile common globals like normal definitions
-fno-complete-member-pointers
Do not require member pointer base types to be complete if they would be significant under the Microsoft ABI
-fno-constant-cfstrings
Disable
-fno-constant-nsarray-literals
Disable creation of CodeFoundation-type constant initializer `NSArray`s from array literals
-fno-constant-nsdictionary-literals
Disable creation of CodeFoundation-type constant initializer `NSDictionary`s from dictionary literals
-fno-constant-nsnumber-literals
Disable creation of CodeFoundation-type constant initializer `NSNumber`s from number literals
-fno-coverage-mapping
Disable code coverage analysis
-fno-crash-diagnostics
Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
-fno-cuda-approx-transcendentals
Don't use approximate transcendental functions
-fno-debug-info-for-profiling
-fno-debug-macro
Do not emit macro debug information
-fno-debug-ranges-base-address
-fno-declspec
Disallow __declspec as a keyword
-fno-delayed-template-parsing
Disable delayed template parsing
-fno-delete-null-pointer-checks
Do not treat usage of null pointers as undefined behavior
-fno-diagnostics-fixit-info
Do not include fixit information in diagnostics
-fno-digraphs
Disallow alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:'
-fno-discard-value-names
Do not discard value names in LLVM IR
-fno-dollars-in-identifiers
Disallow '$' in identifiers
-fno-double-square-bracket-attributes
Disable '[[]]' attributes in all C and C++ language modes
-fno-elide-constructors
Disable
-fno-elide-type
Do not elide types when printing diagnostics
-fno-exceptions
Disable support for exception handling
-fno-experimental-new-pass-manager
Disables an experimental new pass manager in LLVM
-fno-experimental-relative-c++-abi-vtables
Do not use the experimental C++ class ABI for classes with virtual tables
-fno-fine-grained-bitfield-accesses
Use large-integer access for consecutive bitfield runs
-fno-fixed-point
Disable fixed point types
-fno-force-enable-int128
Disable support for int128_t type
-fno-global-isel
Disables the global instruction selector
-fno-gnu-inline-asm
Disable GNU style inline asm
-fno-gpu-allow-device-init
Don't allow device side init function in HIP
-fno-hip-new-launch-api
Don't
-fno-integrated-as
Disable the integrated assembler
-fno-integrated-cc1
Spawn a separate process for each cc1
-fno-jump-tables
Do not use jump tables for lowering switches
-fno-keep-static-consts
Don't
-fno-lto
Disable LTO mode (default)
-fno-merge-all-constants
Disallow merging of constants
-fno-no-access-control
Disable C++ access control
-fno-objc-infer-related-result-type
Do not infer Objective-C related result type based on method family
-fno-operator-names
Do not treat C++ operator name keywords as synonyms for operators
-fno-pch-codegen
Do not generate code for uses of this PCH that assumes an explicit object file will be built for the PCH
-fno-pch-debuginfo
Do not generate debug info for types in an object file built from this PCH and do not generate them elsewhere
-fno-plt
Use GOT indirection instead of PLT to make external function calls (x86 only)
-fno-preserve-as-comments
Do not preserve comments in inline assembly
-fno-profile-generate
Disable generation of profile instrumentation
-fno-profile-instr-generate
Disable generation of profile instrumentation
-fno-profile-instr-use
Disable using instrumentation data for profile-guided optimization
-fno-ptrauth-abi-version
Disable Pointer Authentication ABI versioning
-fno-ptrauth-kernel-abi-version
Disable Pointer Authentication kernel ABI versioning
-fno-register-global-dtors-with-atexit
Don't use atexit or __cxa_atexit to register global destructors
and 501 more — all of them are in the JSON