Commit Graph

42 Commits

Author SHA1 Message Date
Rui Ueyama 9f4ce9c6b0 Add atomic_exchange 2020-09-22 18:34:00 +09:00
Rui Ueyama df70d36779 Add atomic_compare_exchange 2020-09-22 18:34:00 +09:00
Rui Ueyama 16f2439ab6 [GNU] Support labels-as-values 2020-09-22 18:34:00 +09:00
Rui Ueyama a057954aed Add long double 2020-09-22 18:34:00 +09:00
Rui Ueyama 9e8779bfa9 Add pointer arithmetic for VLA 2020-09-22 18:34:00 +09:00
Rui Ueyama c89571c652 Add sizeof() for VLA 2020-09-22 18:34:00 +09:00
Rui Ueyama 16ecd67b6e [GNU] Allow sizeof(<function type>) 2020-09-22 18:34:00 +09:00
Rui Ueyama c52d5173db [GNU] Add __builtin_types_compatible_p 2020-09-22 18:34:00 +09:00
Rui Ueyama 51d0bffbef Add usual arithmetic conversion for function pointer 2020-09-22 18:34:00 +09:00
Rui Ueyama dddcea280a Add function pointer 2020-09-22 18:34:00 +09:00
Rui Ueyama f3667e271c Add flonum +, -, * and / 2020-09-22 18:33:34 +09:00
Rui Ueyama efd10ced54 Add flonum ==, !=, < and <= 2020-09-22 18:33:34 +09:00
Rui Ueyama 0d85517407 Add floating-point constant 2020-09-22 17:39:48 +09:00
Rui Ueyama 56c967c71b When comparing two pointers, treat them as unsigned 2020-09-21 19:00:47 +09:00
Rui Ueyama fd14c5b8e1 Add U, L and LL prefixes 2020-09-21 19:00:47 +09:00
Rui Ueyama 10192ad2d8 Add unsigned integral types 2020-09-21 19:00:47 +09:00
Rui Ueyama 0924ab0aa5 Add ?: operator 2020-09-21 19:00:41 +09:00
Rui Ueyama 1bb4c6d4b8 Add <<, >>, <<= and >>= 2020-09-21 19:00:41 +09:00
Rui Ueyama f9a327ae97 Add a notion of an incomplete struct type 2020-09-21 19:00:40 +09:00
Rui Ueyama c7cb814fec Add && and || 2020-09-21 19:00:39 +09:00
Rui Ueyama fcc9daa39d Add &, |, ^, &=, |= and ^= 2020-09-21 19:00:39 +09:00
Rui Ueyama 4af75d51f7 Add % and %= 2020-09-21 19:00:39 +09:00
Rui Ueyama fad13556b5 Add ~ operator 2020-09-21 19:00:39 +09:00
Rui Ueyama 775db13f37 Add ! operator 2020-09-21 19:00:39 +09:00
Rui Ueyama d7f3435730 Add enum 2020-09-21 19:00:38 +09:00
Rui Ueyama 733e0dc2cb Add _Bool type
_Bool isn't just a 1-bit integer because when you convert a value
to bool, the result is 1 if the original value is non-zero. This
is contrary to the other small integral types, e.g. char, as you
can see below:

  char x  = 256; // x is 0
  _Bool y = 256; // y is 1
2020-09-20 16:20:06 +09:00
Rui Ueyama 3aef744406 Implement usual arithmetic conversion 2020-09-20 16:20:06 +09:00
Rui Ueyama 8260122116 Add void type 2020-09-20 16:20:05 +09:00
Rui Ueyama 549373b3bd Add short type 2020-09-20 16:20:05 +09:00
Rui Ueyama 98af405a2f Add long type 2020-09-20 16:20:05 +09:00
Rui Ueyama cb0065e352 Change size of int from 8 to 4 2020-09-20 16:20:05 +09:00
Rui Ueyama c821c4f709 Align struct members 2020-09-20 16:19:34 +09:00
Rui Ueyama d16f54ba0a Add struct 2020-09-20 16:19:18 +09:00
Rui Ueyama b09f5ae7ae Add comma operator
This patch allows writing a comma expression on the left-hand side
of an assignment expression. This is called the "generalized lvalue"
which is a deprecated GCC language extension. I'm implementing it
anyway because it's useful to implement other features.
2020-09-13 21:36:54 +09:00
Rui Ueyama addd1bfd52 [GNU] Add statement expression
This is a GNU C extension but will be useful for writing tests.
2020-09-13 21:36:37 +09:00
Rui Ueyama 471da0ff48 Add char type 2020-09-13 21:36:37 +09:00
Rui Ueyama d63f00b63c Add one dimensional arrays 2020-09-13 21:36:37 +09:00
Rui Ueyama 2f6f348735 Support function definition up to 6 parameters 2020-09-13 21:36:37 +09:00
Rui Ueyama 3706bb32a3 Support zero-arity function definition 2020-09-13 21:36:37 +09:00
Rui Ueyama 227656548c Support zero-arity function calls 2020-09-13 21:36:37 +09:00
Rui Ueyama a8702a3011 Add keyword "int" and make variable definition mandatory 2020-09-13 21:36:37 +09:00
Rui Ueyama f26c8c26aa Make pointer arithmetic work 2020-09-13 21:36:37 +09:00