Commit Graph

42 Commits

Author SHA1 Message Date
Rui Ueyama 80ea9d427c Add atomic_exchange 2020-12-07 12:00:06 +09:00
Rui Ueyama ca27455b92 Add atomic_compare_exchange 2020-12-07 12:00:06 +09:00
Rui Ueyama 4f165ec60b [GNU] Support labels-as-values 2020-12-07 12:00:06 +09:00
Rui Ueyama e0bf168041 Add long double 2020-12-07 12:00:06 +09:00
Rui Ueyama 07f901057f Add pointer arithmetic for VLA 2020-12-07 12:00:06 +09:00
Rui Ueyama e8667afd08 Add sizeof() for VLA 2020-12-07 12:00:06 +09:00
Rui Ueyama aee7891acb [GNU] Allow sizeof(<function type>) 2020-12-07 12:00:06 +09:00
Rui Ueyama 1433b404d6 [GNU] Add __builtin_types_compatible_p 2020-12-07 12:00:06 +09:00
Rui Ueyama 53e81033ce Add usual arithmetic conversion for function pointer 2020-12-07 12:00:06 +09:00
Rui Ueyama d06a8ac6e6 Add function pointer 2020-12-07 12:00:06 +09:00
Rui Ueyama 83f76ebb66 Add flonum +, -, * and / 2020-12-07 12:00:06 +09:00
Rui Ueyama cf9ceecb2f Add flonum ==, !=, < and <= 2020-12-07 12:00:06 +09:00
Rui Ueyama 1e57f72d8a Add floating-point constant 2020-12-07 12:00:06 +09:00
Rui Ueyama 6880a39d2a When comparing two pointers, treat them as unsigned 2020-12-07 12:00:06 +09:00
Rui Ueyama aaf10459d9 Add U, L and LL suffixes 2020-12-07 12:00:06 +09:00
Rui Ueyama 34ab83bdf4 Add unsigned integral types 2020-12-07 12:00:06 +09:00
Rui Ueyama 447ee098c5 Add ?: operator 2020-12-07 12:00:06 +09:00
Rui Ueyama d0c0cb74b2 Add <<, >>, <<= and >>= 2020-12-07 12:00:06 +09:00
Rui Ueyama 61a1055120 Add a notion of an incomplete struct type 2020-12-07 12:00:06 +09:00
Rui Ueyama f30f78175c Add && and || 2020-12-07 12:00:06 +09:00
Rui Ueyama 86440068b4 Add &, |, ^, &=, |= and ^= 2020-12-07 12:00:06 +09:00
Rui Ueyama daa739817c Add % and %= 2020-12-07 12:00:06 +09:00
Rui Ueyama 46a96d6862 Add ~ operator 2020-12-07 12:00:06 +09:00
Rui Ueyama 6b88bcb306 Add ! operator 2020-12-07 12:00:06 +09:00
Rui Ueyama 48ba2656fe Add enum 2020-12-07 12:00:05 +09:00
Rui Ueyama 44bba965cb 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-12-07 12:00:05 +09:00
Rui Ueyama 8b430a6c5f Implement usual arithmetic conversion 2020-12-07 12:00:05 +09:00
Rui Ueyama 8c3503bb94 Add void type 2020-12-07 11:51:20 +09:00
Rui Ueyama 9d48eef58b Add short type 2020-10-15 14:22:16 +09:00
Rui Ueyama 43c2f0829f Add long type 2020-10-15 14:22:16 +09:00
Rui Ueyama 5831edaab3 Change size of int from 8 to 4 2020-10-15 14:22:16 +09:00
Rui Ueyama 9443e4b8bc Align struct members 2020-10-15 14:22:16 +09:00
Rui Ueyama f814033d04 Add struct 2020-10-15 14:22:16 +09:00
Rui Ueyama e6307ad374 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-10-15 14:22:16 +09:00
Rui Ueyama 9dae23461e [GNU] Add statement expression
This is a GNU C extension but will be useful for writing tests.
2020-10-08 15:43:05 +09:00
Rui Ueyama be38d63d1b Add char type 2020-10-07 20:13:26 +09:00
Rui Ueyama 8b6395d0f2 Add one dimensional arrays 2020-10-07 20:13:26 +09:00
Rui Ueyama aacc0cfec2 Support function definition up to 6 parameters 2020-10-07 20:13:26 +09:00
Rui Ueyama 6cb4220f33 Support zero-arity function definition 2020-10-07 20:13:25 +09:00
Rui Ueyama 30a3992627 Support zero-arity function calls 2020-10-07 20:13:25 +09:00
Rui Ueyama b4e82cf7ce Add keyword "int" and make variable definition mandatory 2020-10-07 20:13:25 +09:00
Rui Ueyama a6bc4ab101 Make pointer arithmetic work 2020-10-07 20:13:25 +09:00