Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Cannot retrieve the latest commit at this time.
Permalink
| Failed to load latest commit information. | |||
|
|
Documentation |
|
|
|
|
bugs |
|
|
|
|
include |
|
|
|
|
lib |
|
|
|
|
src |
|
|
|
|
test |
|
|
|
|
test2 |
|
|
|
|
tools |
|
|
|
|
win32 |
|
|
|
|
.gitignore |
|
|
|
|
LICENSE |
|
|
|
|
Makefile |
|
|
|
|
README |
|
|
|
|
TODO |
|
|
|
|
configure |
|
|
|
|
ucc |
|
|
README
A C Compiler written in C Requirements ============ as (I use gnu as, but any should be fine) ld (any form should be fine) Obviously you need a compiler to compile this compiler with. Standard system include files are supported - barring a preprocessor bug with multiple function macro expansions on the same line (e.g. glibc's tgmath.h) - barring __asm__ statements (feature/asm) System libraries are fully supported, including ABI compatability with things like va_list. Compiling (the compiler) ======================== ./configure [--as=path/to/as] make Compiling C files ================= POSIX 'cc' standard arguments plus a few extra. No make install target yet, ucc uses libaries from the usual place. Major C-Features Todo ===================== - by-value argument passing for structure/union types (feature/1st-class-struct-args) - long long types on 32-bit archs - long-double type - complex types (_Complex) Examples ======== ./ucc -o hello hello.c - preprocess, compile, assemble and link hello.c into hello ./ucc -o- -S test.c - output assembly code for test.c ./ucc -o- -S -Xprint test.c - show the abstract parse tree with type annotation and stack offsets, etc ./ucc -c test.c - (preprocess) compile and assemble test.c -> test.o ./ucc -c test.s - assemble test.s -> test.o (preprocessing and compilation are skipped) ./ucc -fenglish -Xprint -o- test.c - (-fenglish) show the abstract parse tree with output decls in english e.g.: int *(*const (*x)(void))(int); becomes: "x": pointer to function(taking no arguments) returning const pointer to function(int) returning pointer to int ./ucc test.c a.o -o out b.a - preprocess + compile test.c, and link with a.o and b.a to form the executable out ./ucc a.o b.c -E - preprocess b.c - a.o is ignored since it's not linked with