c3c(1)
๐ NAME ๐
c3c โ the compiler for the C3 programming language, manual section 1 of the User Commands pages. yes bestie, this is the whole thing, buckle up ๐
โจ SYNOPSIS โจ
c3c [options ...] command [args ...]
that's it. that's the whole shape of it. options first, then the command, then whatever args that command wants ๐ฆ
๐ธ DESCRIPTION ๐ธ
c3c is the compiler for the C3 language, and she does a lot โ compilation, project management, testing, and distribution all live in here. like, the commands available let you compile files, initialize projects, build targets, run benchmarks, clean build files, and more. she's the whole toolbox, not just the hammer ๐
๐ COMMANDS ๐
okay so this is the menu of things you can actually ask her to do. pick one, she'll handle it โจ
c3c compile file1 [file2 ...]โ compile files without a project, straight into an executable. no project scaffolding needed, we're free-spiriting it ๐ฆc3c init project nameโ initialize a brand new project structure. main character energy from day one ๐c3c init-lib library nameโ same idea but for a library structure instead of an app ๐c3c build [target]โ build the target inside the current project ๐ฅc3c benchmark [target]โ run the benchmarks for the target in the current project. numbers go brrr ๐c3c test [target]โ run the unit tests for the target in the current project. manifesting all green for you ๐งc3c cleanโ clean all the build files. the great purge ๐c3c run [target] [-- [arg1 ...]]โ run the target in the current project, and build it first if needed. anything after--gets passed as args ๐ซถc3c dist [target]โ clean and build a target for distribution. this is the going-out outfit version ๐ฆc3c clean-run [target] [-- [arg1 ...]]โ clean, then run the target. fresh slate, then go ๐c3c compile-run file1 [file2 ...] [-- [arg1 ...]]โ compile the files then immediately run the result, no waiting around โกc3c compile-only file1 [file2 ...]โ compile the files but do not perform linking. all the parse, none of the join ๐c3c compile-benchmark file1 [file2 ...]โ compile files into a test-executable and run benchmarks. (yes, that's what the page says โ test-executable, benchmarks. I'm not making it up, I'm just reading it ๐)c3c compile-test file1 [file2 ...]โ compile files into a benchmark-executable and run unit tests. (again: benchmark-executable, unit tests. the page said it, not me ๐ญ)c3c static-lib file1 [file2 ...]โ compile files without a project into a static library ๐งฑc3c dynamic-lib file1 [file2 ...]โ compile files without a project into a dynamic library ๐c3c vendor-fetch library ...โ fetches one or more libraries from the vendor collection. shopping spree, but make it deps ๐๏ธc3c project subcommand ...โ manipulate or view project files ๐c3c fetch-sdk windows|macos|android ...โ fetches the SDK you need for cross-compiling. pick yourwindows,macos, orandroidera ๐c3c docgen [path1 path2 ...]โ generate documentation for the project, or for specific files and directories. future you says thank you ๐
๐ OPTIONS ๐
this section is long, bestie. we're going through every single one, no skipping, no summarising. hydrate first ๐
๐ Help & version vibes
-h,-hh,--helpโ print the help.-hgives you the normal options,-hhgives you the full help. go-hhif you're feeling brave ๐-V,--versionโ print version information. know your era โจ
๐ Volume control
-q,--quietโ silence unnecessary output. she's in her quiet luxury bag ๐คซ-v,-vv,-vvvโ verbose output.-vfor default verbose, and-vv/-vvvgive you more information. escalating yapping, but useful ๐ข
๐งช Pipeline-stopper flags (stop early, peek inside)
-Eโ lex only. just the tokens, ma'am ๐ฌ-Pโ only parse and output the AST as JSON ๐ณ-Cโ only lex, parse and check. no further, we're just validating vibes โ
๐ด I/O bits
- code...โ read code from standard in. yes, a lone dash then your code, piped right in ๐ซถ-o fileโ write output tofile๐
๐ฅ Optimization levels (read these carefully, bestie)
-O0โ safe, no optimizations, emit debug info ๐ฃ-O1โ safe, high optimization, emit debug info ๐-O2โ unsafe, high optimization, emit debug info โ ๏ธ-O3โ unsafe, high optimization, single module, emit debug info ๐งจ-O4โ unsafe, highest optimization, relaxed maths, single module, emit debug info, no panic messages ๐-O5โ unsafe, highest optimization, fast maths, single module, emit debug info, no panic messages, no backtrace ๐-Osโ unsafe, high optimization, small code, single module, no debug info, no panic messages ๐-Ozโ unsafe, high optimization, tiny code, single module, no debug info, no panic messages, no backtrace ๐
fr fr, notice how -O2 and up are unsafe. that's not decorative, that's the actual deal. safety is a setting here, not a default you can assume ๐ธ
๐ท๏ธ Feature flags
-D nameโ add feature flagnameโ-U nameโ remove feature flagnameโ
๐ Info about the thing itself
--aboutโ prints a short description of C3 ๐--build-envโ prints build environment information. this one's only valid in combination with a command such as'compile'๐
๐ Where stuff goes & where stuff's found
--run-dir dirโ set the directory from where to run the binary. only forrunandcompile-run๐โโ๏ธ--libdir dirโ add this directory to the c3l library search paths ๐--lib nameโ add this c3l library to the compilation ๐งฉ--sources file1 [file2 ...]โ add these additional sources to the compilation ๐--validation= optionโ how strict the code validation is:lenient(default),strict,obnoxious(very strict). yes, obnoxious is the real name ๐ญ--stdlib dirโ use this directory as the C3 standard library path ๐๏ธ--no-entryโ do not generate (or require) amainfunction. no entry point, no problem ๐ช--path dirโ use this as the base directory for the current command ๐งญ--template templateโ select the template for'init':"exe","static-lib","dynamic-lib"or a path ๐จ
๐ง Resource-ish knobs
--symtab valueโ sets the preferred symtab size ๐--max-mem valueโ set the maximum memory size (in MB) ๐งฎ
๐ Run behaviour
--run-onceโ after running the output file, delete it immediately. one and done, iconic and terrifying ๐--suppress-runโ build but do not run on test/benchmark options ๐ โโ๏ธ--trust= optionโ trust level:none(default),include($includeallowed),full($exec/execallowed) ๐
๐ Directory overrides (the whole drawer)
--output-dir dirโ override the general output directory ๐ฆ--build-dir dirโ override the build output directory ๐๏ธ--obj-out dirโ override the object file output directory ๐งฑ--script-dir dirโ override the base directory where scripts are searched ๐--exec-dir dirโ override the base directory for$execandexecโก--llvm-out dirโ override the llvm output directory for'--emit-llvm'๐--asm-out dirโ override the asm output directory for'--emit-asm'๐ง--header-output dirโ override the header file output directory when building libraries ๐
๐งพ Emit this, emit that
--emit-llvmโ emit LLVM IR as a.llfile per module ๐--emit-asmโ emit asm as a.sfile per module ๐ ๏ธ--objโ emit object files (enabled by default) โ--no-objโ do not output object files; this is only valid forcompile-only๐ซ--no-headersโ do not generate C headers when building a library ๐
๐ฏ Targets & threads
--target targetโ compile for a particular architecture + OS target ๐--threads numberโ set the number of threads to use for compilation ๐งต
๐ก๏ธ Safety & panics
--safe= yes|noโ turn safety (contracts, runtime bounds checking, null pointer checks etc) on or off ๐ฆบ--panic-msg= yes|noโ turn panic message output on or off ๐ฑ
โ๏ธ Optimization fine-tuning
--optlevel= optionโ code optimization level:none,less,more,max๐--optsize= optionโ code size optimization:none,small,tiny๐ค--unroll-loops= yes|noโ enable loop unrolling ๐--loop-vectorize= yes|noโ enable loop auto-vectorization ๐ฏ--slp-vectorize= yes|noโ enable SLP (superword-level parallelism) auto-vectorization ๐งฌ--merge-functions= yes|noโ enable function merging ๐ซ--function-sections= yes|noโ place each function in its own section, so the linker can discard unused ones (no effect on Mach-O) ๐๏ธ--data-sections= yes|noโ place each global variable in its own section, so the linker can discard unused ones (no effect on Mach-O) ๐๏ธ--single-module= yes|noโ compile all modules together, enables more inlining ๐งฉ--show-backtrace= yes|noโ show detailed backtrace on segfaults ๐
๐ฉบ Diagnostics & warnings
--lspโ emit data about errors suitable for a LSP ๐ง--print-large-functionsโ print functions with large compile size ๐--warn-deadcode= yes|no|errorโ print warning on dead-code:yes,no,error๐ง--warn-recursivecontracts= yes|no|errorโ print warning on recursive contracts:yes,no,error๐--warn-methodvisibility= yes|no|errorโ print warning when methods have ignored visibility attributes ๐--warn-methodsnotresolved= yes|no|errorโ print warning on methods not resolved when accessed:yes,no,error๐ง--warn-deprecation= yes|no|errorโ print warning when using deprecated code and constructs:yes,no,error๐ฐ๏ธ--warn-builtin= yes|no|errorโ print warning when using builtin functions outside of the stdlib:yes,no,error๐
๐ Debug info
-gโ emit debug info ๐ชฒ-g0โ emit no debug info ๐ซ
๐จ Pretty output
--ansi= yes|noโ set colour output using ansi on/off, default is to try to detect it ๐--echo-prefix argโ sets the prefix for any output using'$echo', defaults to'c3c:'๐ฌ
๐งช Test runner settings
--test-filter argโ set a filter when running tests, running only matching tests ๐ฃ--test-breakpointโ when running tests, trigger a breakpoint on failure ๐--test-nosortโ do not sort tests ๐--test-noleakโ disable tracking allocator and memory leak detection for tests ๐ฐ--test-show-outputโ disable test stdout capturing, all tests can print as they run ๐ข--test-nocaptureโ disable test stdout capturing, all tests can print as they run, same as--test-show-output๐ฏโโ๏ธ--test-quietโ run tests without printing full names, printing output only on failure ๐ค--test-log-level= verbose|debug|info|warn|error|criticalโ set log priority when running tests ๐
๐ Benchmark output
--benchmark-csv-reportโ print a CSV report after benchmarks have completed ๐
๐ Linking & libraries
-l libraryโ link with the static or dynamic library provided ๐-L library dirโ append the directory to the linker search paths ๐บ๏ธ-z argumentโ send the argument as a parameter to the linker ๐จ--cc pathโ set C compiler (for C files in projects and use as system linker) ๐ ๏ธ--linker= option [path]โ linker:builtin,cc,custom(default is'cc'), and'custom'requires a path โ--use-stdlib= yes|noโ include the standard library (default:yes) ๐--link-libc= yes|noโ link libc and other default libraries (default:yes) ๐งท--custom-libc= yes|noโ set to true if a custom libc implementation is provided (default:no) ๐งช--emit-stdlib= yes|noโ output files for the standard library (default:yes) ๐๏ธ--emit-only fileโ output only the file matchingfile๐ฏ
๐ท๏ธ Symbol name overrides
--panicfn nameโ override the panic function name ๐ฅ--testfn nameโ override the test runner function name ๐งช--benchfn nameโ override the benchmark runner function name โฑ๏ธ
๐งญ Codegen & cpu
--reloc= optionโ relocation model:none,pic,PIC,pie,PIE๐งฑ--cpu-flags stringโ add/remove cpu flags from the default, e.g.'+a,-b'๐๏ธ--x86cpu= optionโ set general level of x64 cpu:baseline,ssse3,sse4,avx1,avx2-v1,avx2-v2(Skylake/Zen1+),avx512(Icelake/Zen4+),native๐ฅ๏ธ
okay that's the end of part 1, and part 2 is coming right up ๐ซถ
--x86vec=option โ caps the fanciest vector type the compiler will use. Your options:none,mmx,sse,avx,avx512,default. Pick your vibe ๐--riscv-abi=option โ sets which RISC-V ABI you're on:int-only,float, ordouble. choose wisely bestie.--riscv-cpu=option โ picks the general level of your RISC-V cpu:rvi(that's the default for 32-bit),rvimac,rvimafc,rvgc(default for 64-bit),rvgcv. lowkey a whole alphabet soup but slay ๐ธ--memory-env=option โ sets the memory environment:normal,small,tiny,none. it's giving "how much room do we have to breathe" ๐ซถ--strip-unused=yes|no โ strips unused code and globals out of the output. default isyes, so the compiler is already doing the cleanup for you โจ--fp-math=option โ floating point math behaviour:strict,relaxed,fast.strictis the goody-two-shoes,fastis the reckless main character ๐ญ--win64-simd=option โ Win64 SIMD ABI:array,full.--win-debug=option โ picks the debug output format on Windows:codeviewordwarf. default iscodeview๐ช--max-vector-sizenumber โ the biggest vector bit size you're allowed to use. default is4096, which is already huge ngl.--max-stack-object-sizenumber โ biggest size a stack object can be, in KB. default is128๐ง--max-macro-iterationsnumber โ the max number of times a macro loop can go around before it gets told to chill. default is1048575, so like... a lot ๐--print-linkingโ prints the linker arguments. nosy but make it fashion.--benchmarkingโ runs the built-in benchmarks ๐ฅ--testingโ runs the built-in tests. very responsible of you tbh ๐--list-attributesโ lists every attribute.--list-builtinsโ lists every builtin.--list-keywordsโ lists every keyword.--list-operatorsโ lists every operator.--list-precedenceโ lists the operator precedence order, aka who goes first ๐--list-project-propertiesโ lists all the available keys used inproject.jsonfiles.--list-manifest-propertiesโ lists all the available keys used inmanifest.jsonfiles.--list-targetsโ lists every architecture the compiler supports ๐--list-type-propertiesโ lists all type properties.--list-asmโ lists every asm instruction for the current target. heads up: you must use it together with a compilation command likecompileorbuild, or it just won't hit ๐ซถ--print-outputโ prints the object files it created to stdout.--print-inputโ prints the C3 files it was given to stdout.--win-sdkdir โ sets the directory for Windows system library files when you're cross compiling.--wincrt=option โ Windows CRT linking:none,static-debug,static,dynamic-debug(this one's the default if debug info is enabled),dynamic(default). lots of options but periodt ๐--windeffile โ uses a Windowsdeffile for function exports instead ofdllexport.--win-vs-dirsdir;dir โ overrides the Windows VS detection. note the semicolon between the two dirs, bestie โ it's not a typo โจ--win-subsystem=subsystem โ the Windows subsystem:console(default),windows(default if@winmainis present),native,posix,boot,efi-app,efi-boot,efi-romorefi-runtime. the efi girlies are eating ๐--macos-sdkdir โ sets the directory for the MacOS SDK when you're cross compiling.--macos-min-versionver โ sets the minimum MacOS version to compile for.--macos-sdk-versionver โ sets the MacOS SDK version compiled for.--linux-libc=host|gnu|musl โ sets which libc to use on Linux. defaults tohost๐ง--linux-crtdir โ sets the directory used for findingcrt1.oand related files.--linux-crtbegindir โ sets the directory used for findingcrtbegin.oand related files.--android-ndkdir โ sets the NDK directory location.--android-apiver โ sets the Android API version.--bsd-sysrootdir โ sets the BSD sysroot directory.--sanitize=option โ turns on a sanitizer:address,memory,thread. friendship bracelets for your memory bugs ๐
โจ EXAMPLES โจ
bestie these are copy-paste ready, go off ๐ฆ
Create a project:
c3c init new_project
Create a library project:
c3c init-lib new_library
Compile a file:
c3c compile main.c3
Build the current project:
c3c build
Run tests for the current project:
c3c test
that's the whole page, no cap ๐ the C3 Compiler was being iconic on 2026-07-03, and yes the man page footer literally reads c3c(1) โ she's a classic, iykyk ๐
๐ฆ where this page comes from
- nixpkgs unstable: c3c 0.8.5_1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms