Skip to main content
TinyCC implements comprehensive C language support, including full ANSI C, most of ISO C99, and many GNU C extensions. This makes TCC compatible with a wide range of existing C code while maintaining its small size and fast compilation speed.

ANSI C compliance

TCC implements all the ANSI C standard features:
  • Structure bit fields with full type support
  • Floating point numbers (long double, double, and float fully supported)
  • All standard data types and operations
  • Complete preprocessor implementation
TCC includes a full C preprocessor, so you can use all standard preprocessor directives including #include, #define, #ifdef, and conditional compilation.

ISO C99 extensions

TinyCC implements many features of the ISO C99 standard. Currently missing items are complex and imaginary numbers.

Supported ISO C99 features

VLAs allow you to declare arrays with runtime-determined sizes:
Full support for 64-bit integer types:
The _Bool type is supported for boolean values:
__func__ is a string variable containing the current function name:
__VA_ARGS__ can be used for function-like macros with variable arguments:

Additional C99 features

The inline and restrict keywords are recognized but currently ignored by TCC.

GNU C extensions

TCC implements many GNU C extensions for compatibility with GCC code.

Designator extensions

Extended syntax

  • Escape character: \e is ASCII character 27 (ESC)
  • Case ranges: Use ranges in switch cases

Attributes

The __attribute__ keyword allows specifying variable and function attributes:
This generates the function in the specified assembly section.
For regparm(n), the first n parameters go in registers %eax, %edx, and %ecx.
  • unused: Suppress warnings for unused variables/functions
  • dllexport: Export function from DLL/executable (Windows)
  • nodecorate: Don’t apply decorations when exporting (Windows)

Advanced features

Built-in functions

TCC supports several GCC built-in functions:

Inline assembly

Full support for GCC-style inline assembly with a gas-like (GNU assembler) syntax:
TCC includes its own x86 inline assembler with gas-like syntax. No intermediate files are generated, and GCC 3.x named operands are supported.

TinyCC-specific extensions

Predefined macros

  • __TINYC__: Defined to indicate TCC is being used
  • __TCC_BCHECK__: Defined when bounds checking is enabled (-b option)
  • __TCC_BACKTRACE__: Defined when backtrace support is enabled (-bt option)

Script support

#! at the start of a line is ignored to allow C scripting. Make the file executable with chmod +x and run it directly.

Binary literals

Binary digit literals are supported:

Compatibility notes

__FUNCTION__ interpretation: TCC interprets __FUNCTION__ as C99 __func__ (a variable), not as a string literal like GCC does.

Pragma support

#pragma pack is supported for Windows compatibility:

Standard version

Use -std=version to control __STDC_VERSION__:
  • -std=c11 or -std=gnu11: Sets to 201112
  • Otherwise: Sets to 199901