update
This commit is contained in:
		
							parent
							
								
									ebdec645a8
								
							
						
					
					
						commit
						a88b855866
					
				
					 3 changed files with 29 additions and 39 deletions
				
			
		
							
								
								
									
										2
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -11,7 +11,7 @@ LIBS=-ldl
 | 
				
			||||||
CFLAGS+=-m386 -malign-functions=0
 | 
					CFLAGS+=-m386 -malign-functions=0
 | 
				
			||||||
DISAS=objdump -D -b binary -m i386
 | 
					DISAS=objdump -D -b binary -m i386
 | 
				
			||||||
INSTALL=install
 | 
					INSTALL=install
 | 
				
			||||||
VERSION=0.9
 | 
					VERSION=0.9.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: tcc
 | 
					all: tcc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										49
									
								
								README
									
										
									
									
									
								
							
							
						
						
									
										49
									
								
								README
									
										
									
									
									
								
							| 
						 | 
					@ -5,7 +5,7 @@ Features:
 | 
				
			||||||
--------
 | 
					--------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- SMALL! You can compile and execute C code everywhere, for example on
 | 
					- 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
 | 
					- FAST! tcc generates optimized x86 code. No byte code
 | 
				
			||||||
  overhead. Compiles, assemble and link about 7 times faster than 'gcc
 | 
					  overhead. Compiles, assemble and link about 7 times faster than 'gcc
 | 
				
			||||||
| 
						 | 
					@ -87,35 +87,17 @@ when doing 'make test'.
 | 
				
			||||||
Exact differences with ANSI C:
 | 
					Exact differences with ANSI C:
 | 
				
			||||||
-----------------------------
 | 
					-----------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1) Preprocessor
 | 
					- Preprocessor: the preprocessor tokens are the same as C. It means
 | 
				
			||||||
 | 
					  that in some rare cases, preprocessed numbers are not handled
 | 
				
			||||||
 - the preprocessor tokens are the same as C. It means that in some
 | 
					  exactly as in ANSI C. This approach has the advantage of being
 | 
				
			||||||
  rare cases, preprocessed numbers are not handled exactly as in ANSI
 | 
					  simpler and FAST!
 | 
				
			||||||
  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).
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Types: floating point numbers are not supported yet.
 | 
					- 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.
 | 
					- Linking: extern variables must appear in a referenced dll and cannot
 | 
				
			||||||
 | 
					  appear in current source.
 | 
				
			||||||
- 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.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
Supported ANSI C extensions:
 | 
					Supported ANSI C extensions:
 | 
				
			||||||
---------------------------
 | 
					---------------------------
 | 
				
			||||||
| 
						 | 
					@ -126,15 +108,20 @@ Supported ANSI C extensions:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- '__func__' is a string variable containing the current function name (ISOC99).
 | 
					- '__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__).
 | 
					   #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
 | 
					- Array and struct/union elements can be initialized in any order by
 | 
				
			||||||
  using designators (.e. { [0].x = 1 }) (ISOC99).
 | 
					  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:
 | 
					Technical Description:
 | 
				
			||||||
---------------------
 | 
					---------------------
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										15
									
								
								TODO
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								TODO
									
										
									
									
									
								
							| 
						 | 
					@ -2,17 +2,20 @@ TODO list:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Critical:
 | 
					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
 | 
					- add float/double support (should be as small as possible while being
 | 
				
			||||||
  usable for RISC code generator too).
 | 
					  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:
 | 
					Not critical:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- 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
 | 
					- fix preprocessor symbol redefinition
 | 
				
			||||||
- better constant opt (&&, ||, ?:)
 | 
					- better constant opt (&&, ||, ?:)
 | 
				
			||||||
- add ELF executable and shared library output option (would be needed
 | 
					- add ELF executable and shared library output option (would be needed
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue