| ANTCC(1) | General Commands Manual | ANTCC(1) |
NAME
antcc - a little C compiler
SYNOPSIS
Usage: antcc [options] infile(s)...
[options] -run infile [arguments...]
[options] infile(s)... -run [arguments...]
DESCRIPTION
antcc is a C compiler supporting ISO C11. It also supports some C23 features and GNU C extensions.
Options are similar to GCC's. The antcc executable contains the driver, preprocessor, compiler and runtime library. Different options control what stage to stop at.
For example:
- "antcc a.c b.c"
- Compile a.c and b.c and generate the executable a.out.
- "antcc -c a.c"
- Compile a.c and generate the object file a.o.
- "antcc -E a.c"
- Preprocess a.c and print output to stdout.
- "antcc prog.c -o prog -run foo"
- Compile prog.c to executable prog and execute it with argument 'foo'
OPTIONS
- -std=<..>
- Set C standard (c89, c99, c11, c23).
- -o file
- Write the output to file.
- -c
- Emit object file but do not link.
- -run
- Run compiled sources.
- -x<c|o>
- Specify type of next input file (c: C source; o: object file).
- -v
- Verbose output.
- --version
- Print version.
Preprocessor options:
- -iquote dir
- -isystem dir
- -idirafter dir
- -I dir
- Add include path dir with given priority (see gcc(1)).
- -no-standard-includes
- -nostdinc
- Skip standard system include paths.
- -Dsym[=val]
- Define macro.
- -Usym
- Undefine macro.
- -E
- Preprocess only.
Compilation flags:
- -O<..>
- Set optimization level (0|g|1|2|s|z) (default: -Og).
- -target triple
- Compile for a given target.
- -f[no-]pie
- Whether to emit code for position independent executable.
- -f[no-]pic
- Whether to emit position independent code.
- -f[no-]wrapv
- Whether to treat signed integer overflow as well-defined wrapping.
Linking options:
- -llib
- Link with library.
- -Ldir
- Add directory to linker's library search path.
- --sysroot=dir
- Set target system root for headers/libs.
- -Bdir
- Set compiler/libc directory path (headers and libs).
- -Wl,options
- Pass comma-separated options to the linker.
- Generate a shared library.
- -static
- Generate a static executable.
- -static-pie
- Generate a static position independent executable.
- -pthread
- Link with POSIX threads library.
Diagnostics options:
- -W[...]
- Turn on warnings (stub).
- -Werror
- Turn warnings into errors.
- -pedantic
- Warnings for strict standards compliance.
- -w
- Suppress warnings.
- -fsyntax-only
- Only preprocess and semantically analyze, don't compile.
Debug options:
- -dparse
- print IR after parse.
- -dbefore=x,...
- -dafter=x,...
- print IR before/after given passes.
Passes: abi,mem2reg,lowerintrin,copyopt,optimize,inline,
loopopt,cselim,simpl,gcm,sinkcond,lowerstack,isel,regalloc, - -dp=x,...
- equivalent to "-dbefore=x,... -dafter=x,..."
- -dinliner
- -dregalloc
- -dloop
- print pass-specific debug infos.
- -dfilter=f,...
- only print IR/debug info for given function(s).
Meta:
- --help
- Print a help message to the standard output with a summary of options.
- --man
- Generate this man page. If stdout is an interactive terminal, use man(1) to display it; otherwise, output the raw roff(7) document.
- -dumpversion
- Dump raw version string.
- -print-targets
- Print recognized compilation target triples.
- -print-effective-triple
- -print-target-triple
- -dumpmachine
- Dump host machine target triple.
- -keep-temps
- Don't delete temporary files.
ENVIRONMENT
Environment variables that affect antcc. Boolean flags can be enabled by setting them to any of "yes","1","true","Y","T".
- $NO_COLOR
- Disable color diagnostics.
- $TMPDIR
- Directory for temporary files (default /tmp).
- $ANTCC_CACHE_DIR
- Directory for cached files (default ~/.cache/antcc).
- $ANTCC_VERBOSE
- Equivalent to -v option.
- $ANTCC_IRCHECK
- Verify IR after every pass (useful for development).
- $ANTCC_GNUC
- Define preprocessor macros to pretend to be GCC 4.2.1
SEE ALSO
AUTHORS
lemon <lsof@mailbox.org>
| 2026 | 0.4.6 |