mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
update
This commit is contained in:
parent
ebdec645a8
commit
a88b855866
2
Makefile
2
Makefile
@ -11,7 +11,7 @@ LIBS=-ldl
|
||||
CFLAGS+=-m386 -malign-functions=0
|
||||
DISAS=objdump -D -b binary -m i386
|
||||
INSTALL=install
|
||||
VERSION=0.9
|
||||
VERSION=0.9.1
|
||||
|
||||
all: tcc
|
||||
|
||||
|
49
README
49
README
@ -5,7 +5,7 @@ Features:
|
||||
--------
|
||||
|
||||
- SMALL! You can compile and execute C code everywhere, for example on
|
||||
rescue disks (27KB for x86 TCC executable).
|
||||
rescue disks (29KB for x86 TCC executable).
|
||||
|
||||
- FAST! tcc generates optimized x86 code. No byte code
|
||||
overhead. Compiles, assemble and link about 7 times faster than 'gcc
|
||||
@ -87,35 +87,17 @@ when doing 'make test'.
|
||||
Exact differences with ANSI C:
|
||||
-----------------------------
|
||||
|
||||
1) Preprocessor
|
||||
|
||||
- the preprocessor tokens are the same as C. It means that in some
|
||||
rare cases, preprocessed numbers are not handled exactly as in ANSI
|
||||
C. This approach has the advantage of being simpler and FAST!
|
||||
|
||||
2) C language
|
||||
|
||||
- Cannot pass struct/union as value. Cannot assign struct/union (use
|
||||
memcpy instead).
|
||||
- Preprocessor: the preprocessor tokens are the same as C. It means
|
||||
that in some rare cases, preprocessed numbers are not handled
|
||||
exactly as in ANSI C. This approach has the advantage of being
|
||||
simpler and FAST!
|
||||
|
||||
- Types: floating point numbers are not supported yet.
|
||||
|
||||
- (BUG) 'char' and 'short' casts do not truncate correctly.
|
||||
- Bit fields are not supported.
|
||||
|
||||
- 'sizeof' may not work if too complex expression is given.
|
||||
|
||||
- bit fields are not supported.
|
||||
|
||||
- L'c' or L"string" for wide chars are parsed but not handled as wchar_t.
|
||||
|
||||
- Cannot initialize auto (=local) arrays with implicit size
|
||||
(workaround: specificy exact size in array declaration). Cannot
|
||||
initialize auto arrays with strings.
|
||||
|
||||
3) Linking
|
||||
|
||||
- extern variables must appear in a referenced dll and cannot appear
|
||||
in current source.
|
||||
- Linking: extern variables must appear in a referenced dll and cannot
|
||||
appear in current source.
|
||||
|
||||
Supported ANSI C extensions:
|
||||
---------------------------
|
||||
@ -126,15 +108,20 @@ Supported ANSI C extensions:
|
||||
|
||||
- '__func__' is a string variable containing the current function name (ISOC99).
|
||||
|
||||
- variadic macros: __VA_ARGS__ can be used for function-like macros (ISOC99):
|
||||
- Variadic macros: __VA_ARGS__ can be used for function-like macros (ISOC99):
|
||||
#define dprintf(level, __VA_ARGS__) printf(__VA_ARGS__).
|
||||
|
||||
- declarations can appear anywhere in a block (ISOC99).
|
||||
- Declarations can appear anywhere in a block (ISOC99).
|
||||
|
||||
- array and struct/union elements can be initialized in any order by
|
||||
using designators (.e. { [0].x = 1 }) (ISOC99).
|
||||
- Array and struct/union elements can be initialized in any order by
|
||||
using designators (.e.g. { [0].x = 1 }) (ISOC99).
|
||||
|
||||
- binary digits can be entered ('0b101' instead of '5').
|
||||
- Compound initializers are supported (e.g. int *p = (int []){ 1, 2,
|
||||
3}) (ISOC99).
|
||||
|
||||
- '#!' at the start of a line is ignored to allow scripting.
|
||||
|
||||
- Binary digits can be entered ('0b101' instead of '5').
|
||||
|
||||
Technical Description:
|
||||
---------------------
|
||||
|
17
TODO
17
TODO
@ -2,18 +2,21 @@ TODO list:
|
||||
|
||||
Critical:
|
||||
|
||||
- add structure assign.
|
||||
- fix 'char' and 'short' casts.
|
||||
- 0 is pointer - fix type compare
|
||||
- fix L'' and L"" wide chars
|
||||
- add message if external function or variable not found.
|
||||
- function pointers to forward reference (patch code generator).
|
||||
- add float/double support (should be as small as possible while being
|
||||
usable for RISC code generator too).
|
||||
- 0 is pointer - fix type compare
|
||||
- add message if external function or variable not found.
|
||||
- To check: 'sizeof' may not work if too complex expression is given.
|
||||
- fix 'char' and 'short' casts (in function parameters and in assignment).
|
||||
- function pointers to forward reference (patch code generator).
|
||||
|
||||
Not critical:
|
||||
|
||||
- fix preprocessor symbol redefinition
|
||||
- fix multiple compound literals inits in blocks (ISOC99 normative
|
||||
example - only relevant when using gotos! -> must add boolean
|
||||
variable to tell if compound literal was already initialized).
|
||||
- fix L"\x1234" wide string case (need to store them as ints ?) */
|
||||
- fix preprocessor symbol redefinition
|
||||
- better constant opt (&&, ||, ?:)
|
||||
- add ELF executable and shared library output option (would be needed
|
||||
for completness!).
|
||||
|
Loading…
Reference in New Issue
Block a user