Name
gcc
Synopsis
gcc [options] files
Description
Compile one or more C source files (file.c), assembler source files (file.s), or preprocessed C source files (file.i). If the file suffix is not recognizable, assume that the file is an object file or library. gcc automatically invokes the link editor ld (unless -c, -S, or -E is supplied). In some cases, gcc generates an object file having a .o suffix and a corresponding root name. By default, output is placed in a.out. gcc accepts many system-specific options not covered here.
Note: gcc is the GNU form of cc; on most Linux systems, the command cc will invoke gcc. The command g++ will invoke gcc with the appropriate options for interpreting C++.
Options
- -a
Provide profile information for basic blocks.
- -ansi
Enforce full ANSI conformance.
- -b machine
Compile for use on machine type.
- -c
Create linkable object file for each source file, but do not call linker.
- -dD
Print #defines.
- -dM
Suppress normal output. Print series of #defines that are in effect at the end of preprocessing.
- -dN
Print #defines with macro names only, not arguments or values.
- -fno-asm
Do not recognize asm, inline, or typeof as keywords. Implied by -ansi.
- -fno-builtin
Do not recognize built-in functions unless they begin with two underscores.
- -fno-gnu-keywords
Do not recognize classof, headof, signature, sigof, or typeof as keywords.
- -fno-ident
Do not respond to #ident commands.
- -fsigned-bitfields , -funsigned-bitfields , -fno-signed-bitfields , -fno-unsigned-bitfields ...
Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.