aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 4a22bf80abb0b0e6bc0e47097a7e49f798dc5a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
[![builds.sr.ht status](https://builds.sr.ht/~mcf/cc.svg)](https://builds.sr.ht/~mcf/cc)

This is a C11 compiler using [QBE] as a backend.

There is still much to do and the code is a little rough, but it currently
implements most of the language, is self-hosting, and capable of building
some useful software.

## Requirements

The compiler itself is written in standard [C11] and can be built with
any conforming C11 compiler.

The POSIX driver depends on POSIX.1-2008 interfaces, and the Makefile
requires a POSIX-compatible make(1).

The preprocessor is not yet implemented, so an existing one is currently
required.

## Target configuration

You will need to create a `config.h` appropriate for the target system. If
missing, a default version will be created from `config.def.h`,
which should work for most glibc systems, or musl systems with
`-D 'DYNAMIC_LINKER="/lib/ld-musl-x86_64.so.1"'`.

## What's missing

- Digraph and trigraph sequences ([6.4.6p3] and [5.2.1.1], will not
  be implemented).
- Wide string literals and character constants ([#35] and [#36]).
- Variable-length arrays ([#1]).
- `volatile`-qualified types ([#7]).
- `_Thread_local` storage-class specifier ([#5]).
- `long double` type ([#3]).
- Inline assembly ([#5]).
- Preprocessor ([#6]).
- Generation of position independent code (i.e. shared libraries,
  modules, PIEs).

## Issue tracker

Please report any issues to https://todo.sr.ht/~mcf/cc-issues.

[QBE]: https://c9x.me/compile/
[C11]: http://port70.net/~nsz/c/c11/n1570.html
[5.2.1.1]: http://port70.net/~nsz/c/c11/n1570.html#5.2.1.1
[6.4.6p3]: http://port70.net/~nsz/c/c11/n1570.html#6.4.6p3
[#1]: https://todo.sr.ht/~mcf/cc-issues/1
[#3]: https://todo.sr.ht/~mcf/cc-issues/3
[#5]: https://todo.sr.ht/~mcf/cc-issues/5
[#6]: https://todo.sr.ht/~mcf/cc-issues/6
[#7]: https://todo.sr.ht/~mcf/cc-issues/7
[#35]: https://todo.sr.ht/~mcf/cc-issues/35
[#36]: https://todo.sr.ht/~mcf/cc-issues/36