Brainlet C Compiler




bcc - brainlet C compiler



[-c|-i|-A|-S|-E] [-svwC] [-O olevel] [-o output] [-m mach_opt] [-I include_path] [-D name[=value]] [-U name] [-L directory] [-l library] source






The bcc compiler is a small compiler for a C-like language. The language and the compiler are not fully complete and contain bugs. If no -c, -i, -A, -S or -E options are specified, bcc will try to link all generated object files into an executable.


-o output

Specify the output file (or ’-’ for standard output). By default the output file is derived from the source file, except one of the -A or -E options was specified, then it is standard output.


Compile and assemble the program.


Only emit the abstract syntax tree of the program, as interpreted by the parser.


Only emit the intermediate representation.


Emit the assembly output.


Only pre-process the file.

-O olevel

Specify the optimization level. (possible values: 0, 1, 2, 3)


Strip all unnecessary information from the generated executable.


Print verbose output.


Disable all warnings.


Print the version information.

-m mach_opt

Specify a target-dependend option.


Print a simple help message.


Print the target machine.


Print the version.


Print the target machine architecture.

-dumpmacros, -dM

Dump all predefined macros.


Don’t search the default include paths.


Same as -nostartfiles and -nolibc combined.


Don’t link against the crtX.o object files.


Don’t link against the C library.


Don’t link against the crt{begin,end}.o object files.


Link the program with the static libc. (default)


Link the program with the shared libc. (unimplemented)


Don’t delete the generated temporary files.


Suppress the color output.

-I include_path

Specify an include path for the preprocessor to search.

-D name[=value]

Specify a predefined macro.

-U name

Remove macro name

-L directory

Add directory to the search paths of the linker.

-l library

Tell the linker to link the executable against library.


Specify the path to the linker.


Specify the path to the assembler.


Specify the path to the pre-processor.



The output file, to which to write the resulting output.


The source file, for which to generate the output.


The optimization level to perform. (default: 1)
Optimization levels 2 and below are considered "stable" and should not break the program.
Optimization level 3 is considered experimental and may be unsafe, therefore it is not recommended to use it.
An olevel of more than 3 has the same effect as level 3.


A target-specific option. For a list of all target-specific options issue bcc -mhelp.


A directory path which will be searched by the preprocessor for #include’s.


The name of a library to link with.


The compiler aims to implement a usable sub-set of the C99 standard, while changing some annoyance and adding a few extensions. Some of the changes break compatibility with the standard, this is intentional. The compiler does not support the full feature-set of neither C99 nor C90. But that was never the goal. This compiler was created as a learning project and as a successor to benc (an even worse compiler than this only available for 32-bit x86).
- do-while does not require a compound statement (eg. do f(); while (1); is valid).
- the pointer ’*’ is part of the type, instead of the name ( int* a; not int *a; ).
- added new basic type byte, which is guaranteed to be exactly 8 bits wide.
- parameter names of function implementations may be omitted. (eg. int add(int, int a) { return a; } ).
- added arraylen operator, which is similar to the sizeof operator. Instead it evaluates to the length in elements of the array.
- the auto keyword behaves as in C++11.
- function pointer types are now consistent (eg. int(int, int)* instead of int(*)(int, int) ).
- added typeof operator, which is similar to the sizeof operator. Instead it evaluates the type and returns a string(const char*).


Supported optimization techniques:
- constant folding (-O1)
- target-specific micro-optimizations (-O1)
- multiply to shift (-O1)
- dead-code elimination (-O1)
- constant evaluation of function call targets (-O1)
- experimental and/or unsafe optimizations (-O3)


Currently supported target architectures:
- i386
- x86_64
- riscv32
- riscv64
- arm

The compiler uses the System V ABI where applicable.
There is no multilib support; the compiler is installed for a single target-architecture. If a second target is wanted, the compiler must be rebuilt and reinstalled for the specific architecture.


bcpp(1), as(1), ld(1)


Copyright © 2021 Benjamin Stürz
License GPLv3+: GNU GPL version 3 or later <>.
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Generated using groff on 2021-12-10 07:56:41 (UTC)

Look at my source code on GitHub Memes
This website is licensed under the terms of the AGPLv3.
Tor link: 3gto4zix3cpwhq32sh5ygsr3brlmgy4pdf26md46e4zpzfzmbftw3cyd.onion