cproc - Man Page

C11 compiler

Synopsis

cproc[options] sources...

Description

cproc is a C11 compiler using QBE as backend. It supports ISO C11, some features from the upcoming C23, and some GNU C extensions.

When invoked without any options, cproc will preprocess, compile, and link sources... and generate an executable a.out file.

The following options are available:

-c

Compile sources to object files rather than linking them.

-D macro[=value]

Define macro to value as if by a preprocessor #define. If value is not given, macro is defined to 1.

-E

Preprocess the input files and print the output rather than compiling.

-I path

Append path to the list of directories to be searched for headers.

-L path

Append path to the list of directories to be searched for libraries.

-l library

Link library to the executable. If library is a relative path, it will be searched through the compiler search paths.

-o output

Write the output to output. By default, output is written to a.out. Or, if -c is used, the output file is determined by replacing the source file extension with .o. Or, if -E or -emit-qbe is used, the output is written to standard output.

-s

Strip the symbol table from the generated executable.

-U macro

Undefine a pre-defined macro.

-v

Print the commands run as part of the compile pipeline.

-x format

Force cproc to interpret subsequent source files as format. By default, cproc will determine source code language from the known file extensions. This option forces a different format which can be one of “none”, “c”, “c-header”, “cpp-output”, “qbe”, “assembler”, “assembler-with-cpp”.

-Wa,args..., -Wl,args..., -Wp,args...

For each of these options, pass additional args... to the assembler, linker, or preprocessor respectively. The list of arguments is delimited by commas.

For example, -Wl,--gc-sections will forward the option --gc-sections to the linker.

-static

Link the executable statically.

-nostdlib

Do not use standard library and startup files when linking.

-nostdinc

Do not search default compiler include paths when compiling.

-pthread

This is a short hand of -lpthread.

-g, -O, -pipe, -pedantic

These options are available for compatibility with most common compilers but are currently ineffective.

Authors

cproc was written by Michael Forney <mforney@mforney.org>.

Info

December 7, 2024