blob: 7158b17d637c97e3a5fb5add63e0727d1add9728e52030c1675ffe692da61b9b (
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
56
57
58
59
60
|
p9kcc - a transpiler for testing portability of C code
------------------------------------------------------
p9kcc will be a C89-to-Python3 transpiler (it is still very far from
being complete) that is intended to be maximally weird in every way
allowed by the C89 standard.
It's main purpose is for testing portability of C code, with focus on things
that `-fsanitize=undefined` and `cppcheck` cannot detect.
"Features":
* Weird `CHAR_BIT`. Instead of 8 it is 100, so `char` can have values up to
`2^99-1` instead of the usual maximum of 127 or 255.
* C99 and other "modern" stuff is mostly *un*available.
* The optional fixed-width types `int32_t` etc. are *absent*
(but I might even remove `inttypes.h` entirely, since it's not
part of C89).
* Maximum line length after `\`-joining lines is 509 characters.
Status
------
Mostly done:
* Pre-processor
* Type parsing
In progress:
* Declaration parsing
* Expression parsing
To do:
* Statement parsing
* Basic block handling (Python does not have `goto`)
* Code output
Licence
-------
Copyright © 2026 Samuel Lidén Borell.
This software is free/libre/open source software. You may distribute it
and/or modify it under the terms of either of the following licences:
* EUPL version 1.2 or (at your option) any later version, or
* LGPL version 2.1 or (at your option) any later version.
As with any free/open source project, for any code/content that you
contribute, you accept that it will be permanently made available, modified,
used, and sublicenced, according to the licences above.
The EUPL licence can be found in the file `LICENSE.txt`, and the LGPL
licence can be found in the file `lgpl-2.1.txt`.
The `+` in file headers etc., for example `EUPL-1.2+`, should be read as
"or any later version". It still refers to the same EUPL version 1.2 licence.
|