---
name: "pcc"
section: "1"
platform: "linux"
package: "pcc"
version: "1.2.0~DEVEL+20220331-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pcc"
---

# pcc(1)

front-end to the C compiler

## NAME

**cc** – front-end to the C compiler

## SYNOPSIS

**cc** \[**-cEgkMPSstvX**\] \[**-ansi**\] \[**-B***prefix*\] \[**-D** *macro*\[=*value*\]\] \[**-d***flags*\] \[**-f***feature*\] \[**-I** *path*\] \[**-include** *file*\] \[**-isystem** *path*\] \[**-L***path*\] \[**-m***option*\] \[**-nodefaultlibs**\] \[**-nostartfiles**\] \[**-nostdinc**\] \[**-nostdlib**\] \[**-O**\[*level*\]\] \[**-o** *outfile*\] \[**-pg**\] \[**-pthread**\] \[**-shared**\] \[**-static**\] \[**-std=***standard*\] \[**-U** *macro*\] \[**-Wa**,*options*\] \[**-Wc**,*options*\] \[**-Wl**,*options*\] \[**-Wp**,*options*\] \[**-x** *language*\] \[**-z** *keyword*\] \[*file ...*\]

## DESCRIPTION

The **cc** utility provides a front-end to the “portable C compiler”. Multiple files may be given on the command line. Unrecognized options are sent directly to [ld(1)](/ld/1.md).

Filenames that end with **.c** are passed via [cpp(1)](/cpp/1.md) → [ccom(1)](/ccom/1.md) → [as(1)](/as/1.md) → [ld(1)](/ld/1.md).

Filenames that end with **.i** are passed via [ccom(1)](/ccom/1.md) → [as(1)](/as/1.md) → [ld(1)](/ld/1.md).

Filenames that end with **.s** are passed via [as(1)](/as/1.md) → [ld(1)](/ld/1.md).

Filenames that end with **.S** are passed via [cpp(1)](/cpp/1.md) → [as(1)](/as/1.md) → [ld(1)](/ld/1.md).

Filenames that end with **.o** are passed directly to [ld(1)](/ld/1.md).

The options are as follows:

- **-ansi**

  Synonym for **-std=c89**.

- **-B***prefix*

  Define alternate prefix path for [cpp(1)](/cpp/1.md), [ccom(1)](/ccom/1.md), [as(1)](/as/1.md), or [ld(1)](/ld/1.md) executables.

- **-C**

  Passed to the [cpp(1)](/cpp/1.md) preprocessor to not discard comments.

- **-c**

  Stop after generating object code with [as(1)](/as/1.md). Do not link. The resulting object output is saved as a filename with a “.o” suffix unless **-o** option is used. Note: cannot be combined with **-o** if multiple files are given.

- **-D** *macro*\[=*value*\]

  Passed to the [cpp(1)](/cpp/1.md) preprocessor to define *macro* with an optional *value*.

- **-d***flags*

  Debug options. *flags* is a string of characters, which signify the following actions.

  - **M**

    Cause the preprocessor to output a list of macro definitions.

    any unknown flags are ignored.

- **-E**

  Stop after preprocessing with [cpp(1)](/cpp/1.md). Do not compile, assemble, or link. Output is sent to standard output unless the **-o** option is used.

- **-ffreestanding**

  Assume a freestanding environment.

- **-fPIC**

  Generate PIC code.

- **-fpic**

  Tells C compiler to generate PIC code and tells assembler that PIC code has been generated.

- **-funsigned-char**

  Tell the compiler to treat ‘char’ types as if they were unsigned unless explicitly defined otherwise. **-fsigned-char** can be used to signify the opposite behaviour. The default for the ‘char’ type depends on the compiler target architecture.

- **-fstack-protector**

  Tell the compiler to wrap functions with code which checks at runtime that a stack overflow has not occurred. When stack protection is in effect, the \_\_SSP\_\_ macro will be defined.

- **-g**

  Send **-g** flag to [ccom(1)](/ccom/1.md) to create debug output. Debug information output can be disabled with **-g0**.

- **-I** *path*

  Passed to the [cpp(1)](/cpp/1.md) preprocessor to add header search directory to override system defaults.

- **-include** *file*

  Tells the [cpp(1)](/cpp/1.md) preprocessor to include the *file* during preprocessing.

- **-isystem** *path*

  Defines *path* as a system header directory for the [cpp(1)](/cpp/1.md) preprocessor.

- **-k**

  Generate PIC code. See **-fpic** option.

- **-L***path*

  Passed to the linker, to add *path* to the list of directories searched for shared libraries.

- **-M**

  Pass **-M** flag to [cpp(1)](/cpp/1.md) to generate dependencies for [make(1)](/make/1.md).

- **-m***option*

  Target-dependent options. Multiple **-m** options can be given, the following are supported:

  - ARM

    \-mlittle-endian -mbig-endian -mfpe=fpa -mfpe=vpf -msoft-float -march=armv1 -march=armv2 -march=armv2a -march=armv3 -march=armv4 -march=armv4t -march=armv4tej -march=armv5 -march=armv6 -march=armv6t2 -march=armv6kz -march=armv6k -march=armv7

  - HPPA

    - i386

    - MIPS

    \-mlittle-endian -mbig-endian -mhard-float -msoft-float

  - PDP-10

    - PowerPC

    - Sparc64

    - VAX

    - **-nodefaultlibs**

  Do not link with the system default libraries (libc, etc.)

- **-nostartfiles**

  Do not link with the system startup files (crt0.c, etc.)

- **-nostdinc**

  Do not use the system include paths (/usr/include, etc.)

- **-nostdlib**

  Do not link with the system default libraries or startup files.

- **-O**\[*level*\]

  Enable compiler optimizations. Currently, for levels higher than zero, this defines \_\_OPTIMIZE\_\_ in the [cpp(1)](/cpp/1.md) preprocessor, and passes **-xdce**, **-xdeljumps**, **-xtemps** and **-xinline** to [ccom(1)](/ccom/1.md). If no level is given the optimization level is **-O1**. Optimizations can be disabled using **-O0**. In situations where multiple optimization flags are given, the last flag is the one used.

- **-o** *outfile*

  Save result to *outfile*.

- **-P**

  Inhibit generation of line markers in preprocessor output. This is sometimes useful when running the preprocessor on something other than C code.

- **-pg**

  Enable profiling on the generated executable.

- **-pthread**

  Defines the \_PTHREADS preprocessor identifier for [cpp(1)](/cpp/1.md), and adds **-lpthread** to the [ld(1)](/ld/1.md) linker arguments.

- **-S**

  Stop after compilation by [ccom(1)](/ccom/1.md). Do not assemble and do not link. The resulting assembler-language output is saved as a filename with a “.s” suffix unless the **-o** option is used. Note: cannot be combined with **-o** if multiple files are given.

- **-s**

  Passed to [ld(1)](/ld/1.md) to remove all symbol table and relocation information from the generated executable. This option is silently ignored if **cc** does not invoke the linker.

- **-shared**

  Create a shared object of the result. Tells the linker not to generate an executable.

- **-static**

  Do not use dynamic linkage. By default, it will link using the dynamic linker options and/or shared objects for the platform.

- **-std=***standard*

  Compile to the specified *standard*. Accepted values for *standard* are *c89*, *c99*, *gnu89*, *gnu99*, *gnu9x*, and *c11*.

- **-t**

  Passed to [cpp(1)](/cpp/1.md) to suppress some default macro definitions and enable use of traditional C preprocessor syntax.

- **-U** *macro*

  Passes to the [cpp(1)](/cpp/1.md) preprocessor to remove the initial macro definition.

- **-v**

  Outputs the version of **cc** and shows commands as they are run with their command line arguments.

- **-###**

  As per **-v** except that the commands are not run, and the arguments will be quoted if they contain unusual characters or spaces.

- **-Wa**,*options*

  Comma separated list of options for the assembler.

- **-Wc**,*options*

  Comma separated list of options for the compiler.

- **-Wl**,*options*

  Comma separated list of options for the linker.

- **-Wp**,*options*

  Comma separated list of options for the preprocessor.

- **-X**

  Don't remove temporary files on exit.

- **-x** *language*

  GCC compatibility option; specify the language in use rather than interpreting the filename extension. Currently known language values are **none**, **c**, **c++**, **assembler** and **assembler-with-cpp**. Any unknown **-x** options are passed to [ccom(1)](/ccom/1.md).

- **-z** *keyword*

  Passed to [ld(1)](/ld/1.md). Please refer to the documentation of your linker for acceptable values of *keyword*.

### Predefined Macros

A few macros are predefined by **cc** when sent to [cpp(1)](/cpp/1.md).

- \_\_PCC\_\_

  Set to the major version of [pcc(1)](/pcc/1.md). These macros can be used to select code based on [pcc(1)](/pcc/1.md) compatibility. See the **-v** option.

- \_\_PCC\_MINOR\_\_

  Set to the minor version.

- \_\_PCC\_MINORMINOR\_\_

  Set to the minor-minor version — the number after the minor version.

- \_PTHREADS

  Defined when **-pthread** switch is used.

- \_\_ASSEMBLER\_\_

  Defined when input files have a .S suffix, or if the **-x**assembler-with-cpp option is specified.

Also system- and/or machine-dependent macros may also be predefined; for example: \_\_NetBSD\_\_, \_\_ELF\_\_, and \_\_i386\_\_.

## SEE ALSO

[as(1)](/as/1.md), [ccom(1)](/ccom/1.md), [cpp(1)](/cpp/1.md), [ld(1)](/ld/1.md)

## HISTORY

The **cc** command comes from the original Portable C Compiler by S. C. Johnson, written in the late 70's.

This product includes software developed or owned by Caldera International, Inc.
