Commit Graph

1429 Commits

Author SHA1 Message Date
2d292e69a1 small change to previous whitespace-only commit 2011-03-08 09:26:36 -08:00
545a37b306 some indentation made prev patch pretty; removed it 2011-03-08 01:59:50 -08:00
89059f94c0 refactor post_type() to be explicit about its recursion 2011-03-08 01:47:31 -08:00
772b302187 added a note clarifying post_type() recursion
some ancient pre-K&R C allows a function to return an array
and the array brackets to be put after the arguments, such
that "int c()[]" means the same as "int[] c()"
see:
http://llvm.org/bugs/show_bug.cgi?id=2399
http://java.sun.com/docs/books/jls/third_edition/html/classes.html#38703
2011-03-08 01:33:17 -08:00
585027aa96 tccelf: allow multiply defined weak symbols 2011-03-07 12:18:54 -08:00
e23194a1fa support c99 for-loop init decls 2011-03-07 11:28:31 -08:00
4fbe3cda33 use new weaken_symbol() to fix another real-world corner case 2011-03-07 01:05:09 -08:00
8bcb2ae1b2 factor out symbol weakening into new function 2011-03-07 01:02:23 -08:00
0f0c2d9c02 weak redefinition of a symbol should weaken the original 2011-03-07 00:25:27 -08:00
38cbb40e90 __typeof(t) should not include storage modifiers of t 2011-03-06 22:32:35 -08:00
5d55647a3c tccpp: fix problem in preprocess_skip with empty #
for example:

   #ifdef stuff
   # /* some comment */
   #endif
2011-03-06 19:13:12 +01:00
c27e76aa2a unlink outfile first
file mode problem if the outfile already exists
2011-03-03 21:09:18 +08:00
c93eca4fe4 tccgen: handle __attribute((alias("target"))) 2011-03-03 01:58:45 -08:00
ce8c1886a5 collapse branch in decl(), making way for next patch 2011-03-03 01:07:36 -08:00
3beb383236 handle post-asm-label attributes on variables 2011-03-03 00:55:02 -08:00
823f832630 tcc: fix weak attribute handling 2011-03-02 13:31:09 -08:00
684723488d Replace comment by a blank
- fix my prev commit:
	put declaration above statements to stay c89 compatible
- replace commit by a blank
        #define con(a, b) a/**/b
	this should yield a b, not ab
2011-03-01 09:19:43 +08:00
185fba4189 tcc -E: append a ' ' after subst
We need a ' ' after subst of m in the following case

    #define m(name,r)  name ## r
    #define m0(a,b,c) int m(a,b)   c
    #define m1(a,b,c) int m(a,b)c
    m0(a, b, c);
    m1(a, b, c);
2011-02-27 10:15:15 +08:00
1b85b55059 i386-asm: support "pause" opcode 2011-02-24 09:38:13 -08:00
bec84fa00a tccasm: support alternate .type syntaxes 2011-02-24 09:24:02 -08:00
15b8a57096 tccpp: treat gas comments in .S files as raw text, not tokens 2011-02-23 15:13:08 -08:00
85642f887c fix warning for tcctest.c introduced with my last commit 2011-02-22 13:55:21 +01:00
ab73c9bc4e fix another static struct init issue (arrays with unknown size at end) 2011-02-22 12:15:45 +01:00
dbefae52b0 Fix complex static initializers (handle additional '}' and '{' brackets)
- added an example to test suite
- the "warning: assignment discards qualifiers from pointer target type"
  is present but harmless
2011-02-22 12:15:44 +01:00
a3ebdd0aeb tccpe: support leading underscore for symbols
To make this the default, enable this line in libtcc.c:tcc_new:

    #if defined(TCC_TARGET_PE) && 0
        s->leading_underscore = 1;

and then recompile tcc and also libtcc1.a
2011-02-13 17:44:12 +01:00
11b2d33523 Add support of asm label for variables.
Add support for asm labels for variables, that is the ability to rename
a variable at assembly level with __asm__ ("newname") appended in
its declaration.
See http://gcc.gnu.org/onlinedocs/gcc-4.4.4/gcc/Asm-Labels.html for more
details.
2011-02-09 00:12:57 +01:00
32a682b88f Fix fct asm label: only valid for declaration
- Fix function assembly label mechanism introduced in commit
  9b09fc376e to only accept alternative
  name for function declaration.
- merge the code with the one introduced in commit
  264a103610.
- Don't memorize token for asm label but directly the asm label.
2011-02-09 00:12:57 +01:00
c23400278a Fix incorrect use of basic type as bitflags.
Fix incorrect use of basic types as bitflags and inefficiency in commit
cf36410e30
2011-02-07 23:46:20 +01:00
cf36410e30 Complain for static fct declared w/o file scope
Error out on static function without file scope and give an explaination
to the user

This is a rewrite of e9406c09a3 but
considering problems raised about static local function pointers in
632ee5a540.
2011-02-06 22:50:05 +01:00
3b4b3b75a6 revert "update VT_STRUCT_SHIFT for new VT_VLA" 2011-02-04 17:54:08 -08:00
db560e9439 Revert "Implement C99 Variable Length Arrays"
This reverts commit a5a50eaafe.
2011-02-05 02:33:46 +01:00
38f6467c06 Revert "Reorder increasingly VT_* constants in tcc.h"
This reverts commit 7f00523e2e.
2011-02-05 02:33:46 +01:00
c1b7267a2f Revert "Make TOK_alloca available for x86-64"
This reverts commit af26ac56bf.
2011-02-05 02:33:45 +01:00
4b8470f3ae Revert "Disable C99 VLA when alloca is unavailable."
This reverts commit e3e5d4ad7a.
2011-02-05 02:33:45 +01:00
b0c50fbd4d update VT_STRUCT_SHIFT for new VT_VLA 2011-02-04 14:33:38 -08:00
2775173d4d fix crash with get_tok_str() in skip()
crash was triggered by numbers etc. as unexpected token, i.e.
everything that requires additional information with the token.
2011-02-04 20:23:43 +01:00
e3e5d4ad7a Disable C99 VLA when alloca is unavailable.
* Disable C99 VLA detection when alloca is unavailable and protect the
  new reference to TOK_alloca in decl_initializer in order to compile
  and run for architecture without working alloca.

  Not all code of C99 VLA is commented as it would required many ifdef
  stanza. Just the detection is commented so that VT_VLA is never set
  any type and the C99 VLA code is compiled but never called. However
  vpush_global_sym(&func_old_type, TOK_alloca) in decl_initializer needs
  to be protected by an ifdef stanza as well because it uses TOK_alloca.

* include alloca and C99 VLA tests according to availability of
  TOK_alloca instead of relying on the current architecture
2011-02-04 15:24:48 +01:00
af26ac56bf Make TOK_alloca available for x86-64
TOK_alloca is now available on x86-64 so make put definition of
TOK_alloca outside the BCHECK conditional macro definition but test if
arch is i386 or x86-64. This makes C99 VLA works (understand compile) on
x86-64.
2011-02-04 13:25:38 +01:00
7f00523e2e Reorder increasingly VT_* constants in tcc.h 2011-02-04 02:22:25 +01:00
a5a50eaafe Implement C99 Variable Length Arrays
Implement C99 Variable Length Arrays in tinycc:
- Support VLA with multiple level (nested vla)
- Update documentation with regards to VT_VLA
- Add a testsuite in tcctest.c
2011-02-04 02:22:25 +01:00
d35a3ac375 Correct Changelog wrt. to fix attribution
Correctly attribute the patch bringing support for Debian GNU/kFreeBSD
kernels to Pierre Chifflier.
2011-02-04 02:22:15 +01:00
db6fcce78f tcc: add sysinclude path with -B, like gcc does 2011-02-02 00:00:12 -08:00
e939c4072c add -isystem cmdline option 2011-02-01 23:32:53 -08:00
b88677454b tcctest: plugged memleak (was polluting valgrind reports) 2011-02-01 16:05:57 -08:00
0d9376da70 tccasm: accept bracketed offset expressions 2011-02-01 15:53:48 -08:00
47b4cf22cd tccasm: accept "fmul/fadd st(0),st(n)" (dietlibc ipow/atanh) 2011-02-01 15:49:37 -08:00
87d84b7cb8 tccasm: allow one-line prefix+op things like "rep stosb" 2011-02-01 15:37:58 -08:00
a25325e9be tccasm: define __ASSEMBLER__ for .S files, like gcc does 2011-02-01 15:26:21 -08:00
75c6695932 tccpp: fix bug in handling of recursive macros 2011-02-01 13:23:40 -08:00
cf08675702 weak definitions overrule non-weak prototypes 2011-02-01 09:41:03 -08:00